Start rails server automatically when ever I start my ubuntu machine

前端 未结 2 1041
半阙折子戏
半阙折子戏 2020-12-31 09:38

I have a rails application and I want to start the server automatically whenever the machine boots up. Right now I cd to the directory and then type the rails s

2条回答
  •  猫巷女王i
    2020-12-31 10:14

    You can use a cron job for this. To add the cron job use the command crontab -e. Than you can define a cron job that runs at boot and reboot with @reboot command.

    So you'd have something like:

    @reboot cd /home/[path to project] && rails server
    

提交回复
热议问题