RVM aliasing and actually scratch that.

I’ve just started use rvm in order to switch ruby and rails versions, mainly it’s to switch to rails3 and still have rails 2 as my main rails installation.

This way I can have rails2 for prebuilt applications such as fatfreecrm and the like that are still on rails 2.

It is also possible to install rails3 to start off with and to switch to version 2.3.8 but I started off with 2.3.8 so that how my setup is.

One thing I found very tiredsome was typing

rvm use ruby-1.8.7-p249

followed by

rvm gemset use rails3

so a bit of googling for “rvm alias” comes up with this:

rvm alias create ruby-1.8 ruby-1.8.7-p249

then you just have to type

rvm use ruby-1.8.7;rvm gemset use rails3

I still don’t like typing stuff

Instead i’ve decided to use a bash script in my project files

#!/bin/bash
rvm use ruby-1.8.7-p249
rvm gemset use rails3

which will switch for me when I run it.

If there’s a way to run a script automatically without watching a folder using a particular os I would be interested in knowing.

There’s also a gem called rvmify which will separate gemfiles for you even for the same version of rails (maybe this app works with one version of a gem but breaks in a newer one)

*If you are wondering how to create a gemset, make sure you are using a non-system ruby installation. so `rvm install ruby-1.8.7-p249` for a mac. and then `rvm use ruby-1.8.7-p249` followed by `gem install ruby -v 3`

*turns out rvm is even more awesome with an .rvmrc it’ll do the folder monitoring and switch versions of ruby/rails when you enter that folder.

Something like:

rvm use 1.8.7@rails3 –create

Is the proper way to do it, thanks to ['john','toby','ryan bates','underpants gnome']

I hope nobody minds my blurting out what I learn and then being corrected.

Posted in Uncategorized