sh: ruby command not found

363 views
Skip to first unread message

Adam Salter

unread,
Nov 30, 2008, 7:46:18 PM11/30/08
to Webistrano
I'm getting this strange error in the log (production.log) on my
server every time I try to deploy...
This is the first time I've tried to use Webistrano, so I don't know
what I'm doing wrong...
The webistrano app is running with passenger.
At first I thought it must be that the user passenger is running the
app as didn't have ruby in the path, but ruby is in the path and
capistrano can be used if I 'su apache' to the directory for the app
to deploy...

Can anybody shed any light on this weird issue?

Best,
-Adam

Jonathan Weiss

unread,
Dec 2, 2008, 9:10:17 AM12/2/08
to webis...@googlegroups.com
>
> Can anybody shed any light on this weird issue?

Can you post the complete error message?

What happens if you put the absolute path to ruby in
app/models/deployment.rb line 97?

Jonathan

--
Jonathan Weiss
http://blog.innerewut.de
http://twitter.com/jweiss

Adam Salter

unread,
Dec 2, 2008, 6:10:37 PM12/2/08
to webis...@googlegroups.com
Right this works.
Very odd.
It seems to be something to do with the way passenger runs Rails. I
have a user 'developer' that does the installs and owns the webistrano
directory, but when I 'su developer' and 'which ruby' I get the
correct path. Passenger should run the application as the owner of the
directory. i.e. 'developer'
I also tried using 'env ruby' in the deployment.rb which fails...
I have this:
PATH=$PATH:$HOME/bin:/usr/local/bin
export PATH
at the bottom of /etc/profile.
Ruby is in /usr/local/bin

The really odd thing is that if I print out the variables at time of
execution (i.e. %x[set]) i get an empty string...

At least I have a workaround by hardcoding the path in deployment.rb.

Best,
-Adam

Phill MV

unread,
Dec 2, 2008, 6:39:26 PM12/2/08
to webis...@googlegroups.com
Capistrano doesn't load your profile, so any specific path settings either have to be set by you in your recipe, or you load bash explicitly.

For our uses, using bash --login -c "script goes here" in our tasks does the trick pretty good.

2008/12/2 Adam Salter <adam.q...@gmail.com>
Reply all
Reply to author
Forward
0 new messages