Skip to content

Instantly share code, notes, and snippets.

@Epigene
Last active August 29, 2015 14:19
Show Gist options
  • Save Epigene/ff34621048f941b6ae0d to your computer and use it in GitHub Desktop.
Save Epigene/ff34621048f941b6ae0d to your computer and use it in GitHub Desktop.
Setting up Rails dev environment on Ubuntu as of 2015
If you are on windows, start by setting up an Ubuntu in a VirtualBox
= http://www.psychocats.net/ubuntu/virtualbox
First you wanna update Ubuntu
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
$ sudo reboot
Add repositories
$ add-apt-repository ppa:nginx/stable
$ add-apt-repository ppa:chris-lea/node.js
$ sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-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 -
Install packages
$ apt-get -y update
$ apt-get -y install python-software-properties software-properties-common curl git-core postgresql-common postgresql postgresql-contrib libpq-dev telnet postfix nodejs fish
Install rvm + ruby + bundler
Visit https://www.ruby-lang.org/en/downloads/ to find out latest stable version, then put it in <version> placeholders below
$ sudo apt-get -y install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
$ curl -L https://get.rvm.io | bash -s stable
$ source ~/.rvm/scripts/rvm
$ rvm install <version>
$ rvm use <version>@<PROJECT_NAME> --create
$ rvm use <version>@<PROJECT_NAME> --default
$ ruby -v
$ echo "gem: --no-ri --no-rdoc" > ~/.gemrc
$ gem install bundler
Configure GIT
$ git config --global color.ui true
$ git config --global user.name "<YourGitName>"
$ git config --global user.email "<YourEmail>"
$ eval "$(ssh-agent -s)"
$ ssh-keygen -t rsa -C "augusts@creo.mobi"
$ sudo chmod 400 ~/.ssh/id_rsa
$ ssh-add ~/.ssh/id_rsa
$ ssh-add -l # See if is there
$ sudo cat ~/.ssh/id_rsa.pub >> Add to git keys
$ ssh -T git@github.com
Setup oh-my-fish
$ git clone git://github.com/bpinto/oh-my-fish.git ~/.oh-my-fish
$ cp ~/.oh-my-fish/templates/config.fish ~/.config/fish/config.fish
$ nano ~/.config/fish/config.fish << Put server defaults in
# Have a look at https://gist.github.com/Epigene/f0c3754b1dac4a2da7a4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment