RVM Is a Must for the Rubyist

If you are a Ruby or Rails developer and you haven't heard of RVM yet, I'll let you in on the secret. It rocks! Basically, RVM allows you to easily simultaneously run multiple ruby version on the same machine. You see, Rails 3.0 just came out and I thought it would run on Ruby 1.9.1 but it won't. It require's Ruby 1.9.2. So I upgraded my OS X dev box and manually created the new symlinks. All was well, but I wasn't sure how my apps that required 1.9.1 would behave. So I researched RVM.

To install on your OS X box, it's quite simple. Just make sure that you have XCode installed, as you'll need the GCC.

bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

That's all you need to do to install it!

Edit ~./.bash_profile with the following:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

Open a new shell and you're ready to rock.

To install a Ruby version 1.9.2, just type:

rvm install 1.9.2

Or for version 1.8.7

rvm install 1.8.7

Switch versions like:

rvm 1.9.2

To see where "ruby" is actually installed you type:

which ruby

You'll see:

/Users/jp/.rvm/rubies/ruby-1.9.2-p0/bin/ruby

To see the gem path:

gem env path

Its output:

/Users/jp/.rvm/gems/ruby-1.9.2-p0:/Users/jp/.rvm/gems/ruby-1.9.2-p0@global

It's like magic! Take note: according to the guide, you should NOT run "sudo" to install rvm.

Are you a Git user? Let me help you make project management with Git simple. Checkout Gitpilot.

Read me blog on entrepreneurship: Techneur Follow me on Twitter: @jprichardson

-JP

If you made it this far, you should follow me on Twitter.

-JP

Want to test-drive Bitcoin without any risk? Check out my bitcoin wallet Coinbolt. It includes test coins for free.

comments powered by Disqus