我安装了rspec,也安装了rspec -init。(从这里开始,我已经多次浏览了http://rspec.codeschool.com/levels/1的方向)。
但是,每次我尝试从命令行运行规范时,它都不会加载(请参见下面)。如果你知道可能出了什么问题,请帮忙。
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in
require': cannot load such file -- zombie (LoadError) from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in要求‘from /User/Qureshi/spec/lib/僵尸_spec.rb:2:in<top (required)>' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1226:inload’from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1226:inblock in load_spec_files' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1224:inGems‘from /Library/require': cannot load such file -- zombie (LoadError) from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1224:inload_spec_files' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:97:in安装程序“从/Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:85:inrun' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:70:in运行”从/Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:38:in <load_spec_files' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:97:in>D7‘from /usr/bin/rspec:23:inload' from /usr/bin/rspec:23:in’
发布于 2015-02-22 20:20:22
尝试将以下内容放在spec_helper.rb的顶部:
require_relative '../lib/zombie'
发布于 2015-02-22 19:02:45
确保终端的当前文件夹是User/Qureshi,然后运行命令rspec spec
如果不工作,您的文件(或整个文件夹)将被阻止访问,或者在/Users/Qureshi/spec/lib/中不存在。
https://stackoverflow.com/questions/28661557
复制相似问题