Skip to content

Instantly share code, notes, and snippets.

@ScottHaney
Last active September 2, 2017 04:12
Show Gist options
  • Save ScottHaney/7ca326a72013bca9afbde887d6ad01f3 to your computer and use it in GitHub Desktop.
Save ScottHaney/7ca326a72013bca9afbde887d6ad01f3 to your computer and use it in GitHub Desktop.
Debian linux script for install Ruby on Rails, Postgres, and Passenger
# Ruby prerequisites
sudo apt-get update
sudo apt-get install -y git gcc make libssl-dev libreadline-dev zlib1g-dev
# Native gem extensions prerequisites
sudo apt-get install -y g++
#Install Ruby using rvm
sudo apt-get install -y libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install 2.4.0
rvm use 2.4.0 --default
#Install bundler
gem install --no-rdoc --no-ri bundler
#Install nodejs
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
#Install rails
gem install --no-rdoc --no-ri rails -v 5.1.1
#Install Postgres
sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y postgresql-common
sudo apt-get install -y postgresql-9.5 libpq-dev
#Install Passenger
## Install our PGP key and add HTTPS support for APT
sudo apt-get install -y dirmngr gnupg
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
sudo apt-get install -y apt-transport-https ca-certificates
## Add our APT repository
sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger xenial main > /etc/apt/sources.list.d/passenger.list'
sudo apt-get update
## Install Passenger
sudo apt-get install -y passenger
#Finalize the rails setup
bundle install
@ScottHaney
Copy link
Author

I have used this code to install Ruby on Rails 5 for Ubuntu 16.04. The script is a slightly modified version of the install instructions found at gorails.

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