Linux ボックスを再起動するたびに、rails s
開発環境で Rails アプリを起動するために実行する必要があります。
Linux の再起動時に特定の Rails アプリを自動的に起動する方法はありますか?
ソリューションは、本番環境でアプリを実行することに近いと思います。
実稼働サイトでアプリを実行したことはありません。
更新 1
この問題について詳しく調べてみたところ、身近なものが見つかりました。起動時に「rc.local」を実行するにはどうすればよいですか? .
私の/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 ルート ルート 423 7 月 23 日 12:41 /etc/rc.local
私は次のように実行できます:
$/etc/rc.local &
しかし、次回の起動時に自動的に起動するように実行しようとすると:
sudo /etc/init.d/rc.local start
それは私にエラーを与えています:
Could not find rake-10.2.1 in any of the sources
Run `bundle install` to install missing gems.