Search code examples
rubyrspectextmatetextmatebundles

RSpec TextMate Bundle [spec/autorun (LoadError)]


So I updated to the latest RSpec TextMate Bundle and I'm no longer able to run spec test with "Command R".

  • I have a clean version version of TextMate installed.
  • Rspec version 1.3.1 installed and the executable is working
  • My project is a gem generated by Mr. Bones.
  • No RVM installed

The Project Directory looks like this

my_gem_project
  spec
    model_spec.rb
    spec_helper.rb

When I run "Command R" from textmate to execute a spec I get this spec/autorun LoadError

/Users/jspooner/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/rspec/mate.rb:43:in `require': no such file to load -- spec/autorun (LoadError) from /Users/jspooner/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/rspec/mate.rb:43 from /tmp/textmate-command-767.rb:2:in `require' from /tmp/textmate-command-767.rb:2

The problem is with RSpec.tmbundle/Support/lib/spec/mate.rb because it requires spec which raises a LoadError: no such file to load — spec error.

I'm not sure why this error is raised. I can type spec on the command line but I can't require it in a file that is run by textmate.

Here are my current gem versions.

gem list --local | grep spec
blue_light_special (0.2.0)
rspec (1.3.1)
rspec-rails (1.3.3)

Solution

  • I had the same problem it's because newer versions of the rspec bundle don't require rubygems - this is so it works for people who use other package managing systems (ie Bundler).

    The easiest way to sort this is to add a variable in textmate - details are on the rspec-bundle github README - http://github.com/rspec/rspec-tmbundle

    • open up TextMate Preferences
    • go to the Advanced tab
    • add a variable named RUBYOPT with the value rubygems