Rspec,宝石让我疯狂

时间:2014-08-02 22:07:58

标签: ruby rspec gem rake

我试图在1周内找到答案并且完全迷失了。我会尽量提供尽可能多的信息,但请记住,我甚至不确定如何正确地提供这些信息。

  • Ruby - 2.0.0p451
  • Rspec - 3.0.3
  • gem - 2.4.1

我目前正在尝试通过Testfirst.org的第一个练习'00_hello'

当我在00_hello目录中输入rake时,我得到了这个

(in /Users/AK/Desktop/ruby_master)
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- spec_helper (LoadError)
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1024:in `block in requires='
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1024:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1024:in `requires='
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration_options.rb:101:in `block in process_options_into'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration_options.rb:100:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration_options.rb:100:in `process_options_into'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration_options.rb:22:in `configure'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:96:in `setup'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:85:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:70:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:38:in `invoke'
    from /Library/Ruby/Gems/2.0.0/gems/rspec-core-3.0.3/exe/rspec:4:in `<top (required)>'
    from /usr/bin/rspec:23:in `load'
    from /usr/bin/rspec:23:in `<main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -S rspec /Users/AK/Desktop/ruby_master/00_hello/hello_spec.rb -I/Users/AK/Desktop/ruby_master/00_hello -I/Users/AK/Desktop/ruby_master/00_hello/solution -f documentation -r ./rspec_config failed

我没有改变任何内容,并遵循提供的说明。您最终会创建一个名为“hello.rb”的文件,该文件允许spec文件正常运行。即使我在同一目录中创建它,我也得到与上面相同的输出。

任何见解或帮助将不胜感激。我尝试过安装不同的东西,似乎什么都没有用。

P.S。除了上面的输出之外,我也得到了“rake aborted”。

1 个答案:

答案 0 :(得分:0)

尝试从根目录运行rake,即Rakefile所在的目录。