Jesse Cravens, back to the hub← all sixteen rooms

Site release 0.4.8, build baf2839

The Abandoned Web Archives · R-08 · 26 Sep 2011

RVM (Ruby Version Manager) and Ruby on Rails

Business Computer Programming, Open Source, Productivity, Programming, Ruby on Rails, code

Here is a brief overview of Ruby Version Manager and some explanation as to why you would want to use it. I began to use RVM when I started my first Rails 3 project. It was a bit confusing at first, but now I couldn’t live without it. I have created numerous gemsets for various configurations to include different versions of Ruby (1.87 and 1.91), versions of Rails (2.3, 3.09, 3.1) and different projects that have vastly different gems such as different testing frameworks, different JavaScript libraries, and different ORMs.

This allows me to essentially sandbox each of these applications’ dependencies.

One helpful hint I might offer is to get in the habit of declaring your gemset when you launch a new terminal. I tend to have multiple terminals open at once and it took me awhile to remember that each time I launched a terminal, RVM would fall back to my default gemset. So if I clone a Rails 3.1 project, I need to remember to switch to my rails3.1 gemset prior to runninig bundle install.

Simply put, RVM helps:

  • manage versions of Ruby
  • manage packages of Gemsets

RUBY

1
2
$ rvm list
$ rvm install 1.9.2-head

And, you can set a version as default

1
$ rvm use 1.9.2-head --default

GEMSETS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Start by creating our gemset(s):

$ 
rvm gemset create rails309

# Or create multiple at a time:

$ 
rvm gemset create rails307 rails31

# The result can be verified by listing the available gemsets:

$
 rvm gemset list

# See everything with list_all, this has been very useful:

$ rvm gemset list_all

# If a gem’s name still leaves room for confusion, simply delete it and create a more meaningful one (e.g., rails31rc):

$ 
rvm gemset delete rails31

Now that we have multiple gemsets installed, we must first select the one we want to use, and we can also set it as the default gemset by passing it the —default flag: 


1
$ rvm use 1.9.2-head@rails309 --default

Installing Rails

Installing rails is as easy as installing any other gem: we only need to specify it’s name, but we can always choose a specific version, or to speed up the installation process by skipping the documentation:

1
2
3
4
5
$ gem install rails --no-rdoc --no-ri
# Or
$ gem install rails [-v 3.0.7] [--no-rdoc --no-ri]
# Or
$ gem install rails -v ">=3.1.0rc"

In Summary and Why Am I doing this?

Rails is distributed as a gem, and there are conflicts between Rails 2 and Rails 3, so if you want to run multiple versions of Rails on the same system you need to create a separate gemset for each:

1
2
$ rvm --create 1.8.7-p302@rails2app
$ rvm --create use 1.9.2@rails3app

In other words, for application specific gemsets it is convenient to select the version of Ruby and the collection of gems by doing the following:

1
2
3
4
5
6
$ rvm --create use 1.9.2@mongoid-app

# Also, which gemset am I using?
$ rvm gemset name

$ rvm gemdir

Comments

R-04Harness channel · open

Bring your agent.

This site is a dispatch center. Rooms open, records turn up in the archives, songs ship, and the Dispatch Log keeps the record. Connect your harness and your agent can keep track of it for you.

Want to build something together? Your agent can leave me a note right here. I read every one.

Join the folks out on the edge of AI, building and sharing as we go.

Claude Code: run this once. In claude.ai, add a custom connector with the same URL.

claude mcp add --transport http jessecravens https://jessecravens.com/mcp

# Then ask your agent:
Use the jessecravens tools to tell me what's new on jessecravens.com since you last checked: rooms opened, records found, songs, lab notes. If a dispatch lines up with what I'm working on, draft a short note to Jesse (who I am, which dispatch, what we could build or share). Show me the exact note and wait for my OK before you send it with leave_note.

Notes go to Jesse, never published · your agent drafts, you approve

Get Dispatches

Not running an agent yet? Get the dispatches by email.

Shows again in 7 days