Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leomao10/7b1858dff94a895890cf to your computer and use it in GitHub Desktop.
Save leomao10/7b1858dff94a895890cf to your computer and use it in GitHub Desktop.
# Reference http://stackoverflow.com/a/18490935/2037928
# Login as root
# Install needed packages
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
# Download appropriate ruby version https://www.ruby-lang.org/en/downloads/
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.1.tar.gz
# Unpack
tar -xvzf ruby-2.1.1.tar.gz
cd ruby-2.1.1/
# Compile from source
./configure --prefix=/usr/local
make
make install
# Login as deploy user
# Install bundler
gem install bundler
# Locally
cap production deploy
# Recompile Nginx and upgrade Passenger
# Remove the old manifest.yml file
rm /u/apps/YOUR_APP_NAME/shared/assets/manifest.yml
# I also had to make the unicorn binary into a binstub
@leomao10
Copy link
Author

sudo gem install passenger

Check and see what is your version of passenger

cd /usr/local/lib/ruby/gems/2.1.0/gems/passenger-5.0.4/

Backup nginx.conf

cp /opt/nginx/conf/nginx.conf /home/rails/backup/.
cp -r /opt/nginx/conf/vhosts /home/rails/backup/.

Install passenger-nginx module

sudo passenger-install-nginx-module

Update nginx.conf and point passenger root to the updated version of passenger

sudo vim /opt/nginx/conf/nginx.conf

Restart nginx

sudo /etc/init.d/nginx stop
sudo /etc/init.d/nginx start

Check monit status

sudo monit status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment