I have set up RVM and made individual gemsets for my projects as per the RVM best practices. Now running a test file in TextMate dosen't work and I have read here what to do. The problem is that it won't work because the guide expects me to have just one gemset (they call it "Rails3"). I normally have 2-3 projects open at a time (using different gemsets) so I can't effectively use this approach.
Have any of you solved that problem?
I've found this solution which is even simpler. Under the TextMate Preferences - Advanced - Shell Variables:
Set your GEM_HOME:
Set your GEM_PATH:
I've found the RVM wrappers method to be very buggy, and as you've discovered it doesn't work at all with gemsets unless you do a lot of tedious setup.
I've had some success using the following script as
TM_RUBY
:As long as you're in a TextMate project and you have a
.rvmrc
file in the project root it will run your code in the Ruby version and gemset specified in the.rvmrc
. Thecd
makes sure RVM discovers the.rvmrc
.Put the code above into
~/bin/textmate_ruby_wrapper
and then go to Preferences > Advanced > Shell Variables and setTM_RUBY
to that same path.