good unicorn + nginx + cap deploy howto? good unicorn + nginx + cap deploy howto? nginx nginx

good unicorn + nginx + cap deploy howto?


Just yesterday I had to setup some Unicorns and nginx. I followed:

Also, here is my Unicorn config and init.d script: https://gist.github.com/2049606.

The deploy script I ended up using is almost identical to those mentioned in the links above. If you are using RVM, make sure you add something like:

$:.unshift(File.expand_path('./lib', ENV['rvm_path']))  # Add RVM's lib directory to the load path.require "rvm/capistrano"                                # Load RVM's capistrano plugin.set :rvm_ruby_string, '1.9.3-p125@YOURGEMSET'           # Or whatever env you want it to run in.

A critical point is that you specify the PID files to be in the correct places (I mistyped that and it took me half an hour to find my mistake). Also make sure your user can write all necessary files.


I guess one good answer to this is - https://coderwall.com/p/yz8cha. Its short & sweet and worked very well for me.