Skip to content

Instantly share code, notes, and snippets.

@dictcp
Last active December 20, 2015 05:39
Show Gist options
  • Save dictcp/6079944 to your computer and use it in GitHub Desktop.
Save dictcp/6079944 to your computer and use it in GitHub Desktop.
Install Ruby 2, Rail 4 on Ubuntu 12.04 LTS
#install required packages
apt-get update
apt-get upgrade -y
apt-get install -y git curl build-essential libssl-dev libcurl4-openssl-dev nodejs
#optional
apt-get install libsqlite3-dev sqlite3
#create deployment user
adduser deployer
addgroup deployer sudo
su deployer
#install rbenv, ruby and bundler
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(rbenv init -)"' >> ~/.profile
exec $SHELL -l
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install 2.0.0-p195
rbenv global 2.0.0-p195
gem install bundler
#install passenger
gem install passenger
rbenv rehash
passenger-install-nginx-module
#choose option 1
#install on /home/deployer/nginx
server {
listen 80;
server_name www.yourhost.com;
root /somewhere/public; # <--- be sure to point to 'public'!
passenger_enabled on;
}
## Side ways
## https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment