If you need to use multiple rubies and have been using rvm you might want to consider giving rbenv a try. It's very easy to set up and you can have multiple versions of ruby running in minutes. The github page gives much better instructions than these, but the short of it is...
Setting up rbevn
Install rbenv
- Clone the repo into your home dir into a folder .rbenv
$ cd
$ git clone git://github.com/sstephenson/rbenv.git .rbenv
- Add the following to your .bash_profile, .profile, or .zshrc as applicable (for me I use .profile):
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
$ echo 'eval "$(rbenv init -)"' >> ~/.profile
- Restart your shell or reload your profile:
$ source ~/.profile
Install ruby-build
Install ruby-build (also by sstevenson):
- I normally put my code in a folder called ~/code:
$ cd ~/code
$ git clone git://github.com/sstephenson/ruby-build.git
$ cd ruby-build
- Build it. It will get installed in /usr/local so you will probably need sudo:
$ sudo ./install.sh
Install ruby versions with ease!
$ rbenv install jruby-1.9.3
Note that rbenv adds tab completion if you added the line eval "$(rbenv init -)" as above. So if you type:
rbenv install ree ^I ^I
(where ^I = your tab key) it will show you the available ree versions for example.
So why bother switching from rvm?
I think a lot of it comes down to personal preference so if you love rvm please don't take any of this as criticism of rvm. rbenv does one thing well: switches ruby versions. ruby-build does one thing well, installs rubies. I like that. Also, for me the whole gemset thing just wasn't working. I prefer using (bundler)[bundler.org] to manage my gems and everything installed 'globally' for the version of ruby I'm using so that I am not constantly downloading the same gem for different projects (at least that's how I think rvm is working please correct me if I'm wrong).
blog comments powered by Disqus