/usr/bin/env: ruby: No such file or directory

16 views
Skip to first unread message

Douglas Leonardo

unread,
May 18, 2015, 9:26:54 AM5/18/15
to rubyonra...@googlegroups.com
I am trying to make my application (OpenProject) starting with the
system boot, but to test the script as root, returns me the error:

/usr/bin/env:ruby: No such file or directory.

My script is like this:

#! / bin / bash RAILS_ENV = "production" cd / home / openproject /
openproject su -c openproject "bundle exec rails server"

Someone help?

--
Posted via http://www.ruby-forum.com/.

Scott Ribe

unread,
May 18, 2015, 9:53:15 AM5/18/15
to rubyonra...@googlegroups.com, Douglas Leonardo
On May 18, 2015, at 7:26 AM, Douglas Leonardo <li...@ruby-forum.com> wrote:
>
> /usr/bin/env:ruby

Space, not colon. /usr/bin/env is a command, ruby is an argument to that command.

--
Scott Ribe
scott...@elevated-dev.com
http://www.elevated-dev.com/
https://www.linkedin.com/in/scottribe/
(303) 722-0567 voice





Scott Ribe

unread,
May 18, 2015, 9:56:56 AM5/18/15
to rubyonra...@googlegroups.com, Douglas Leonardo
On May 18, 2015, at 7:26 AM, Douglas Leonardo <li...@ruby-forum.com> wrote:
>
> #! / bin / bash RAILS_ENV = "production" cd / home / openproject /
> openproject su -c openproject "bundle exec rails server"

Sorry, responded too quickly. What follows #! should be the path to the interpreter for the script. So have you really jumbled it all onto one line with lots of extra spaces in the path names, or is that just something that happened when you copied & pasted??? Anyway, should probably be something like:

#! /bin/bash

RAILS_ENV =…

With the command being some that you’ve tested and established actually works—because what you’ve posted in your email certainly wont’ (spaces in the path to your project).

Douglas Leonardo

unread,
May 18, 2015, 10:01:10 AM5/18/15
to rubyonra...@googlegroups.com
Thanks for your reply, in which file I should edit?

Douglas Leonardo

unread,
May 18, 2015, 10:04:00 AM5/18/15
to rubyonra...@googlegroups.com
Scott Ribe wrote in post #1173705:
> On May 18, 2015, at 7:26 AM, Douglas Leonardo <li...@ruby-forum.com>
> wrote:
>>
>> #! / bin / bash RAILS_ENV = "production" cd / home / openproject /
>> openproject su -c openproject "bundle exec rails server"
>
> Sorry, responded too quickly. What follows #! should be the path to the
> interpreter for the script. So have you really jumbled it all onto one
> line with lots of extra spaces in the path names, or is that just
> something that happened when you copied & pasted??? Anyway, should
> probably be something like:
>
> #! /bin/bash
>
> RAILS_ENV =…
>
> With the command being some that you’ve tested and established actually
> works—because what you’ve posted in your email certainly wont’ (spaces
> in the path to your project).

It was just what I posted it came out well, the script is all together
with no spaces.
Reply all
Reply to author
Forward
0 new messages