Here are some notes to remind me how to setup and flip between various ruby configurations.

Ruby setup

rvm list (current versions of ruby installed locally)
rvm list known (all known versions)
rvm 2.1.3 (to switch to this version of ruby)
rvm install 2.1.3
rvm --default use 2.1.3

Rails setup
Rails is setup on a per ruby install basis. So just because you install rails once, doesn’t mean it is available for all rubies.

To see what gems you currently have installed type

gem list

To create a named gemset for this combination of ruby & rails go:

rvm gemset create rails416
rvm gemset list

Now link this version of ruby new version of rails:

rvm 2.1.3@rails416

gemsets for ruby-2.1.3 (found in /Users/jrasmusson/.rvm/gems/ruby-2.1.3)

Now install Rails.

gem install rails -v 4.1.8 --no-ri --no-rdoc

Now to flip between environments we go:

$ rvm 2.1.3@rails410 ; rails --version
Rails 4.1.0
$ rvm 2.1.3@rails320 ; rails --version
Rails 3.2.0

If libxml2 is missing nokogiri

$ gem install nokogiri -- --use-system-libraries
$ bundle config build.nokogiri --use-system-libraries
$ bundle install

If fails on libv8

$ gem uninstall libv8
$ brew install v8
$ gem install therubyracer -v '0.12.1'
$ bundle install
$ gem install libv8 -v '' -- --with-system-v8
$ bundle install

If pg problems

$ bundle install --without production

Links that help