rvm + gemsets + TextMate == yay!
So I started playing with rvm a while back and loved the concept of being able to have a gems(et) for each project to completely eliminate gem clashing.
So I now have an .rvmrc in each project directory with the necessary gems installed, no more, no less.
I also have a global gem set that has common gems in it that I use all over the place and aren’t really project specific so I don’t have to install them in every gems(et). Thanks Wayne!
Now, to take it to the next level I wanted to be able to use ⌘+^+R to run the current Cucumber scenario. So I needed to get TextMate aware of my rvm gems(et). This requires setting 3 project specific variables in TextMate.
- TM_RUBY
- GEM_HOME
- GEM_PATH
To get TM_RUBY cd into your project with a .rvmrc in it or set the environment with rvm your_ruby%gemset then run
which ruby
To get GEM_HOME and GEM_PATH run
env | grep GEM
To set these in your project you need to have the project drawer open and nothing selected, then click the “I” button in the bottom corner, then you can add your variables.
I tried to think up a way to have TextMate read the .rvmrc in the project directory, but I wasn’t able to get anything to setup the environment. If anybody has any suggestions I’d love to hear them.
continue reading
Wayne E. Seguin on rvm + gemsets + TextMate == yay! on Feb 19, 2010 at 11:36 AM
Great writeup!
I’d like to point out one additional item for users of rvm, you can type ‘rvm info’ in your shell to gain the information about your current environment all in one command.
Thanks!
Marnen Laibow-Koser on I prefer GemTools over config.gem on Jun 27, 2009 at 07:01 AM
I’ve never used GemTools, but I used to use geminstaller for similar reasons. However, as config.gem has matured, it has gotten to the point where I am switching applications over from geminstaller; rake gems is a big reason for this.
And for the use case of Capistrano installing everything, you don’t need GemTools. Just put in a suitable Cap task to install the Rails gems to bootstrap the system; then you can rely on config.gem.
Reena on FCKeditor on Rails on Apr 13, 2009 at 04:17 AM
Hi,
Thank You
micahel on Hpricot Scrub on Apr 07, 2009 at 10:11 AM
@chick – was the gem for version 0.3.5 broken for you?
gem install hpricot_scrub
sounds like you may have gotten the old hpricot-scrub gem, which should have been removed from rubyforge, but appears it was still there.
chick on Hpricot Scrub on Mar 26, 2009 at 02:44 PM
forgot to say thanks