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
A very happy Sean on rvm friendly TextMate bundles on Aug 10, 2010 at 02:43 AM
Thanks so much for these. I’d almost give up on getting Textmate working with RVM.
Ed Ruder on rvm + gemsets + TextMate == yay! * 2 on Jul 30, 2010 at 04:06 PM
What got everything working for me was to: a) follow the directions on http://rvm.beginrescueend.com/integration/textmate/, b) rename a second Builder.rb file in ~/Library/Application\ Support/TextMate/Pristine\ Copy/Support/lib, and c) set up TM_RUBY per slides 36 & 37 of http://www.slideshare.net/freelancing_god/zsh-and-rvm (create a shell script that resolves to rvm’s ruby on the fly and point TextMate to it)!
Now, everything is working like a charm! (No mucking with TextMate’s Bundle Editor, either, which is nice.)
Trevor on rvm friendly TextMate bundles on Jun 22, 2010 at 10:20 AM
Really excited to see that you’ve put this together, but I’m having trouble getting it to see anything other than my system Ruby. I’ve set up the .rvmrc in my project w/ the proper ruby and can confirm that it’s seeing the right one. I assume that this is intended to use project-level .rvmrc?
Gerhard on rvm + gemsets + TextMate == yay! * 2 on Jun 02, 2010 at 04:27 AM
This kinda’ works, but I’m getting a weird error related to paths even though the path that it’s complaining about is correct and the file exists, is readable etc.
Also, formatting is all screwy when it uses rvm & gemsets.
jake on rvm + gemsets + TextMate == yay! * 2 on May 18, 2010 at 10:10 AM
You will have to edit each command you want to have these changes in the Bundle Editor.