Trouble launching my RoR server on startup


I created this script to launch my RoR server

==============begin script========================

. /etc/rc.d/init.d/functions


case "$1" in
        cd $EASYRXHOME/
        ruby script/server
        kill -9 `ps aux | grep 'script/server' | awk '{print $2}'`
        echo $"Usage: $0 {start|stop}"
        exit 1

exit $RETVAL
==============end script=========================

But when I try and run the script (when logged in as root), I get this

[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

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

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.


Err, how about looking at line 2 in boot.rb as it shows above?