When I try to run tests from TextMate in Rails3 i get an error that I trace back to boot.rb. When I try to run boot.rb via textmate I get this error:
LoadError: no such file to load — bundler
method gem_original_require in custom_require.rb at line 31
method require in custom_require.rb at line 31
at top level in boot.rb at line 4
This is even in a brand new rails project. I am able to run the same boot.rb file from terminal calling
ruby <path_to>/boot.rb
I can verify that my TM_RUBY variable is the same as when i call which ruby from the command line. Do you have any clue why I might be getting this error?
I ran into this same problem with TextMate and RVM. What you need to do:
Create a wrapper script for the gemset you want to use, using this RVM command:
This will add a new alias to your RVM install called
textmate_ruby. As you can probably tell this assumes you’re using Ruby Enterprise (ree) and a gemset called rails3, but any RVM string will work here.Open TextMate’s preferences window, go to Advanced > Shell Variables. You need to create (or update) the
TM_RUBYshell variable to the following:If your RVM is installed in your user dir (like mine), that’ll be:
(Optional) You may also need/want to set the
RUBYOPTshell variable, to instruct Ruby to load rubygems. This may be necessary to make certain bundles (like RSpec) work. Just set the value torubygems.This should be all you need.