Setting up Ruby on Rails dev environment

Update your apt.

sudo apt-get update

Install some packages.

sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev

Install RVM

curl -L get.rvm.io | bash -s stable

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 184 100 184 0 0 667 0 –:–:– –:–:– –:–:– 666
100 20511 100 20511 0 0 37336 0 –:–:– –:–:– –:–:– 37336
Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz

Installing RVM to /mnt/data/home/max/.rvm/
Adding rvm PATH line to /mnt/data/home/max/.profile /mnt/data/home/max/.bashrc /mnt/data/home/max/.zshrc.
Adding rvm loading line to /mnt/data/home/max/.bash_profile /mnt/data/home/max/.zlogin.
Installation of RVM in /mnt/data/home/max/.rvm/ is almost complete:

  • To start using RVM you need to run source /mnt/data/home/max/.rvm/scripts/rvm
    in all your open shell windows, in rare cases you need to reopen all shell windows.

Set the source

source ~/.rvm/scripts/rvm

max@dungeon:~/Documents$ rvm requirements
Checking requirements for ubuntu.
Requirements installation successful.

check for latest ruby version

rvm list known
……
[ruby-]2.0.0-p353
[ruby-]2.0.0[-p451]
[ruby-]2.1[.1]
[ruby-]2.1-head
ruby-head
…..

Actual installation
In this case its ruby 2.1.1 being installed.

rvm install 2.1.1

Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/13.10/x8664/ruby-2.1.1.
Continuing with compilation. Please read ‘rvm help mount’ to get more information on binary rubies.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /mnt/data/home/max/.rvm/rubies/ruby-2.1.1, this may take a while depending on your cpu(s)…
ruby-2.1.1 – #downloading ruby-2.1.1, this may take a while depending on your connection…
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11.4M 100 11.4M 0 0 1402k 0 0:00:08 0:00:08 –:–:– 1435k
ruby-2.1.1 – #extracting ruby-2.1.1 to /mnt/data/home/max/.rvm/src/ruby-2.1.1…
ruby-2.1.1 – #applying patch /mnt/data/home/max/.rvm/patches/ruby/changeset
r45225.diff.
ruby-2.1.1 – #applying patch /mnt/data/home/max/.rvm/patches/ruby/changeset_r45240.diff.
ruby-2.1.1 – #configuring…………………………………………….
ruby-2.1.1 – #post-configuration.
ruby-2.1.1 – #compiling………………………………………………………………………….
ruby-2.1.1 – #installing……………………………
ruby-2.1.1 – #making binaries executable..
Rubygems 2.2.2 already available in installed ruby, skipping installation, use –force to reinstall.
ruby-2.1.1 – #gemset created /mnt/data/home/max/.rvm/gems/ruby-2.1.1@global
ruby-2.1.1 – #importing gemset /mnt/data/home/max/.rvm/gemsets/global.gems…………………………………………………….
ruby-2.1.1 – #generating global wrappers………
ruby-2.1.1 – #gemset created /mnt/data/home/max/.rvm/gems/ruby-2.1.1
ruby-2.1.1 – #importing gemsetfile /mnt/data/home/max/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.1.1 – #generating default wrappers………
ruby-2.1.1 – #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.1.1 – #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri

Check the ruby version

ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]

Instruct RVM to always use version 2.1.*

max@dungeon:~/Documents$ rvm use 2.1<br></br>
Using /mnt/data/home/max/.rvm/gems/ruby-2.1.1

Install Rails

gem install rails

Grab Text editor of choice

Sublime Text