I'll take a run at this question since I use Chruby and Chgems. I am on Mac OS X, and I have chruby installed via Homebrew.
In my .bashrc
file:
source /usr/local/share/chruby/chruby.sh
chruby ruby-2.0.0-p195
The source line is part of configuration for Chruby.
The second line sets a default version of Ruby for my system (in my case Ruby 2.0.0). Note: As of Chruby 0.3.6 this belongs in .bashrc
instead of .bash_profile
.
In my .bash_profile
:
source /usr/local/share/chruby/auto.sh
This line sets Auto-switching feature in Chruby.
I still have some projects using Ruby 1.9.3 so for those apps I have a .ruby-version
file in the root of the app. with one line ruby-1.9.3
When you cd into the directory for your app, type chgems
and then you can bundle install and what not. You can confirm things are working by entering gem env
To make my life easier I added .bash_aliases for example:
alias myapp='cd ~/Sites/myapp && chgems'
I have been using these together for several months now and really like the combination and yes from what I can tell Chgems does a great job replicating the gemset feature of RVM. I highly recommend you read the docs for both Chruby and Chgems projects as this is all covered. In your case, you may not want to set a default Ruby and just use .ruby-version to set it for each app.