Every time when I restart a linux box, I have to run rails s to start a rails app in dev env.
Is there a way to start a given rails app automatically when linux restarted?
I assume the solution is close to running an app in a production env.
I have never run an app in a production site.
UPDATE 1
I've googled more about the issue and found something close to me How can I make “rc.local” run on startup?.
My /etc/rc/local :
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/home/askar/.rvm/rubies/ruby-2.1.2/bin/ruby /home/askar/work/rails/smn/bin/rails s
exit 0
$ ls -al /etc/rc.local
-rwxr-xr-x 1 root root 423 Jul 23 12:41 /etc/rc.local
I'm able to run by:
$/etc/rc.local &
But when I try to run so that I would startup automatically on next boot:
sudo /etc/init.d/rc.local start
It's giving me the error:
Could not find rake-10.2.1 in any of the sources
Run `bundle install` to install missing gems.