Nginx with Passenger

install a nginx server integrating Passenger

using ruby in RVM for Passenger, also included bundler with RVM
1
2
3
4
5
6
7
8
9
10
# Install RVM for server
curl -sSL https://get.rvm.io | sudo bash -s stable --ruby
vim /etc/group # add all user using rvm into rvm group

# speed up gem install by avoiding docs
echo "gem: --no-ri --no-rdoc" > ~/.gemrc

# install Bundler using RVM
gem install rubygems-bundler
gem install bundler

Install Passenger follow official introduction

Then setup RVM ruby for passenger

1
passenger-config about ruby-command

Copy output after “To use in Nginx” to /etc/nginx/passenger.conf
Should look like this

/etc/nginx/passenger.conf
1
2
3
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
passenger_ruby /usr/local/rvm/gems/ruby-2.3.0/wrappers/ruby;
# replace /usr/bin/passenger_free_ruby to realpath from `passenger-config about ruby-command`