Rspec and/or Rspec-core 的问题
Problems with Rspec and/or Rspec-core
我安装了 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
require'
from /Users/Qureshi/spec/lib/zombie_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:in
load'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1226:in block in load_spec_files'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1224:in
each'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1224:in load_spec_files'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:97:in
setup'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:85:in run'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:70:in
run'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:38:in invoke'
from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/exe/rspec:4:in
'
from /usr/bin/rspec:23:in load'
from /usr/bin/rspec:23:in
'
确保您终端的当前文件夹是 Users/Qureshi 然后 运行 命令 rspec spec
如果它不起作用,您的文件(或整个文件夹)被阻止访问,或者在 /Users/Qureshi/spec/lib/
中不存在
尝试将以下内容放在 spec_helper.rb 的顶部:
require_relative '../lib/zombie'
我安装了 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
require' from /Users/Qureshi/spec/lib/zombie_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:in
load' 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:in
each' from /Library/Ruby/Gems/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
setup' from /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
run' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:38:ininvoke' from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.2.0/exe/rspec:4:in
' from /usr/bin/rspec:23:inload' from /usr/bin/rspec:23:in
'
确保您终端的当前文件夹是 Users/Qureshi 然后 运行 命令 rspec spec
如果它不起作用,您的文件(或整个文件夹)被阻止访问,或者在 /Users/Qureshi/spec/lib/
中不存在尝试将以下内容放在 spec_helper.rb 的顶部:
require_relative '../lib/zombie'