Let’s say when you boot up or restart your virtual machine, you want to run the Rails server in the background for your Rails application. It is pretty easy. First, let’s create a function for the script block. Put following code on the top of the Vagrant file.
# start rails server as a daemon
# to kill: sudo kill `cat tmp/pids/server.pid`
rails s -d
Now in the Vagrantfile configuration block, […]