0

I'm using different books to learn rails and they're all using different versions of ruby and rails. I've got instructions on how to load/use different versions of rails, but I don't know how to do it with ruby.

Can anyone tell me if this is possible and how to indicate which ruby I am using for each app?

i'm using mac os snow leopard. ruby 1.87 is installed currently in usr/bin

1
  • Install them in different paths, or with different names. This is impossible to answer without knowing your OS... but it probably doesn't really belong on SO either (rather, it probably belongs on Superuser)
    – derobert
    Sep 27, 2011 at 17:16

3 Answers 3

9

Use rvm. It manages different ruby versions and even different gemsets (e.g. per application).

1

And if you are using Windows, you could use Pik instead. Does similar things, and allows to explicit switch between ruby versions. You then have to write batch files and switch there explicitly to the right version of ruby before starting the ruby application. It will ensure that the path, load-path, gems, ... are all setup correctly.

0

The combination of rbenv and ruby-build are a lighter weight alternative to the aforementioned RVM, though I prefer RVM personally.

1
  • rbenv is not as mature as RVM - might work or might not ...
    – mpapis
    Oct 27, 2011 at 20:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.