How to start Rails from a shell script on Debian?
- by dsp_099
I don't really have any need to mess with passenger or capistrano at the moment. I simply want to run rails on boot on port 3000. I've attempted to replicate this tutorial for node as much as I could to run rails:
I've a railsup script in /etc/init.d/ that goes something like:
#!/bin/sh
export PATH=$PATH:/usr/local/bin
case "$1" in
start)
cd /root/rails_app; /usr/local/rvm/gems/ruby-2.0.0-p247/bin/rails server -d -p 3005
;;
# starting other stuff
*)
I've also included it with update-rc.d
I got it to work, but only if I run the script manually - it doesn't seem to run on boot. Is there any reason why ../bin/rails is unavailable on boot?
I imagine there's something about ruby path \ rvm \ rails that I'm unaware of? Is there a way to use crontab's @reboot for this?