Skip to content

Instantly share code, notes, and snippets.

@schesnowitz
Last active June 29, 2018 10:19
Show Gist options
  • Save schesnowitz/70732a7dd1c55204b4b2e7b2ab1f0ff1 to your computer and use it in GitHub Desktop.
Save schesnowitz/70732a7dd1c55204b4b2e7b2ab1f0ff1 to your computer and use it in GitHub Desktop.
Setup Ruby On Rails on Ubuntu 16.04
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev nodejs

RVM Setup

sudo apt-get install 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.5.0
rvm use 2.5.0 --default
ruby -v

GIT setup

sudo apt install git
git config --global color.ui true
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR@EMAIL.com"
ssh-keygen -t rsa -b 4096 -C "YOUR@EMAIL.com"

Setup a key for connection to Git

cat ~/.ssh/id_rsa.pub
ssh -T git@github.com

Hi your name! You've successfully authenticated, but GitHub does not provide shell access.

install NodeJS

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

Rails Time (check for latest release here https://rubygems.org/gems/rails/versions)

gem install rails --pre
rails -v

Setting Up PostgreSQL

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 postgresql-common
sudo apt-get install postgresql-9.5 libpq-dev
sudo -u postgres createuser sudo -u postgres createuser myUserName -s

If you would like to set a password for the user, you can do the following

sudo -u postgres psql

postgres=# \password sudo -u postgres createuser myUserName -s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment