Simply deploy Sinatra permanently


Sinatra is an awesome tool for creating dynamic websites really really fast. But their deployment recommendations just don't match their overall KISS ethos. So here is my recommendation if you want to deploy a sinatra app really quickly:

If your sinatra app is in:

/var/www/sinatra/cool_app.rb

Just insert in /etc/rc.local (before the "exit 0" line)

nohup /usr/bin/ruby /var/www/sinatra/cool_app.rb&

And then run the same command. Now your application is running, and the next time your system reboots it will start up again.

2 Response to Simply deploy Sinatra permanently

  1. Nice one, but this doesnt work too well with RVM!

    Get errors :-
    :29:in `require': no such file to load -- sinatra (LoadError)
    from :29:in `require'
    from /var/www/update/update.rb:2:in `'


    You shouldnt need the nohup!

  2. Yeah I wrote this in the days before rvm was widely used.

    This approach will require an rvm profile to be setup for root. Should be possible still.

    And yeah - I don't know why I was using nohup.

Post a Comment