Forked from scmx/upgrade-install-ruby-2-1-2-ubuntu-12-04.md
Last active
August 29, 2015 14:16
-
-
Save leomao10/7b1858dff94a895890cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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