4

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)
4

1 回答 1

2

我遇到了同样的问题,因为较新版本的 rspec 包不需要 ruby​​gems - 这适用于使用其他包管理系统(即 Bundler)的人。

对此进行排序的最简单方法是在 textmate 中添加一个变量 - 详细信息在 rspec-bundle github README - http://github.com/rspec/rspec-tmbundle

  • 打开 TextMate 首选项
  • 转到高级选项卡
  • 添加一个名为 RUBYOPT 的变量,其值为 ruby​​gems
于 2010-12-08T11:27:47.660 回答