laredotornado-8iDLEspWrrZBDgjK7y7TUQ@public.gmane.org
2008-Feb-10 18:25 UTC
Trouble launching my RoR server on startup
Hi, I created this script to launch my RoR server ==============begin script=======================#!/bin/bash . /etc/rc.d/init.d/functions RETVAL=$? EASYRXHOME="/usr/local/apache2/htdocs/easyrx" case "$1" in start) cd $EASYRXHOME/ ruby script/server ;; stop) kill -9 `ps aux | grep ''script/server'' | awk ''{print $2}''` ;; *) echo $"Usage: $0 {start|stop}" exit 1 ;; esac exit $RETVAL ==============end script======================== But when I try and run the script (when logged in as root), I get this error, [root@me dir]# cd /etc/init.d [root@me init.d]# ./easyrxd start ./script/../config/boot.rb:9:in `require'': no such file to load -- rubygems (LoadError) from ./script/../config/boot.rb:9 from script/server:2:in `require'' from script/server:2 Does anyone know what this error means? If I manually type in the start command, RoR starts fine. Thanks, - Dave --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, Not a massive expert on bash, but i have deployed a good number of rails applications now and I would recommend you get hold of mongrel / mongrel_cluster gems and run a set of proxy server instances which apache just forwards the requests to. You''ll need Apache 2.2.x with mod_proxy_balancer, or better, use nginx which is a lot lighter. There are heaps of tutorials out there for setting up mongrel_cluster. The first one i used was http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/ It''s a bit daunting at first, but it is worth it.The rails community generally recommend this configuration. Mongrel cluster comes with the init scripts you need for startup and management, and it prevents thread-locking problems that occur serving lots of page requests due to rails'' single-threaded nature. Best, Joe On Feb 10, 6:25 pm, "laredotorn...-8iDLEspWrrZBDgjK7y7TUQ@public.gmane.org" <laredotorn...-8iDLEspWrrZBDgjK7y7TUQ@public.gmane.org> wrote:> Hi, > > I created this script to launch my RoR server > > ==============begin script=======================> #!/bin/bash > > . /etc/rc.d/init.d/functions > > RETVAL=$? > EASYRXHOME="/usr/local/apache2/htdocs/easyrx" > > case "$1" in > start) > cd $EASYRXHOME/ > ruby script/server > ;; > stop) > kill -9 `ps aux | grep ''script/server'' | awk ''{print $2}''` > ;; > *) > echo $"Usage: $0 {start|stop}" > exit 1 > ;; > esac > > exit $RETVAL > ==============end script========================> > But when I try and run the script (when logged in as root), I get this > error, > > [root@me dir]# cd /etc/init.d > [root@me init.d]# ./easyrxd start > ./script/../config/boot.rb:9:in `require'': no such file to load -- > rubygems (LoadError) > from ./script/../config/boot.rb:9 > from script/server:2:in `require'' > from script/server:2 > > Does anyone know what this error means? If I manually type in the > start command, RoR starts fine. > > Thanks, - Dave--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Sun, 10 Feb 2008, laredotornado-8iDLEspWrrZBDgjK7y7TUQ@public.gmane.org wrote:> But when I try and run the script (when logged in as root), I get this > error, > > [root@me dir]# cd /etc/init.d > [root@me init.d]# ./easyrxd start > ./script/../config/boot.rb:9:in `require'': no such file to load -- > rubygems (LoadError) > from ./script/../config/boot.rb:9 > from script/server:2:in `require'' > from script/server:2Err, how about looking at line 2 in boot.rb as it shows above? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---