简体   繁体   English

RSpec TextMate捆绑包[spec / autorun(LoadError)]

[英]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". 因此,我更新到了最新的RSpec TextMate软件包,并且不再能够使用“ Command R”运行规格测试。

  • I have a clean version version of TextMate installed. 我安装了一个干净的TextMate版本。
  • Rspec version 1.3.1 installed and the executable is working 已安装Rspec 1.3.1版并且可执行文件正在运行
  • My project is a gem generated by Mr. Bones. 我的项目是Bones先生生成的一颗宝石。
  • No RVM installed 未安装RVM

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 当我从textmate运行“ Command R”以执行规范时,得到此规范/自动运行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. 问题在于RSpec.tmbundle / Support / lib / spec / mate.rb,因为它要求spec引发LoadError: no such file to load — spec错误。

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. 我可以在命令行上输入spec,但是我不能在textmate运行的文件中要求它。

Here are my current gem versions. 这是我当前的gem版本。

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

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). 我遇到了同样的问题,这是因为新版本的rspec捆绑包不需要rubygems,因此它适用于使用其他软件包管理系统(例如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 排序最简单的方法是在TextMate中添加一个变量-细节都在RSpec的束GitHub的自述- http://github.com/rspec/rspec-tmbundle

  • open up TextMate Preferences 打开TextMate首选项
  • go to the Advanced tab 转到高级标签
  • add a variable named RUBYOPT with the value rubygems 添加一个名为RUBYOPT的变量,其值为rubygems

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM