I'm working w开发者_开发百科ith Xubuntu 11.04.
I do not succeed to have thin
running at server startup.
when I try the command:
/etc/init.d/thin start
I get the following message:
/usr/bin/env: ruby 1.8: No such file or ...
But the commands ruby -v
is working fine and the result is ruby 1.8.7 (2011-02-18 patchlevel334) Ruby enterprise
rails -v
is also working fine and the result is Rails 2.3.5
If I do the command sudo thin -C configfile.yml start
then the thin server is starting without any issue.
Why can't it be started with the server? What can I do to have it working?
The thin
script is a usual one which is working fine on a Debian-lenny
I got the some error when using sudo gem install unicorn
, and find a solution here. When ruby is not installed in the location /usr/bin/ruby, you need give a full path of ruby which means you need to use command like follows:
/full/path/to/ruby /etc/init.d/thin start
Hope this also works for you.
The header of your file should be:
#!/usr/bin/env ruby
If you include any additional arguments they should be flags for ruby itself, as others may be interpreted as a script name.
What you may have is:
#!/usr/bin/env "ruby 1.8"
Unless you have an executable named ruby 1.8
including the space, that won't work.
精彩评论