簡體   English   中英

運行rake時出現rspec錯誤

[英]rspec error when running rake

我是菜鳥,正在研究許多人可能知道的教程(testfirst.org)。 當我嘗試運行“ rake”時,我在terminal.app中收到以下錯誤:

    fname-lnames-macbook-pro:00_hello macbookowner$ rake
    (in /Users/macbookowner/Desktop/learn_ruby-master)
    /Users/macbookowner/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /Users in PATH, mode 040777
    /Users/macbookowner/Desktop/learn_ruby-master/00_hello/hello_spec.rb:116:in `require': cannot load such file -- hello (LoadError)
        from /Users/macbookowner/Desktop/learn_ruby-master/00_hello/hello_spec.rb:116:in `<top (required)>'
        from /Users/macbookowner/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.5/lib/rspec/core/configuration.rb:896:in `load'
        from /Users/macbookowner/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.5/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
        from /Users/macbookowner/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.5/lib/rspec/core/configuration.rb:896:in `each'
        from /Users/macbookowner/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.5/lib/rspec/core/configuration.rb:896:in `load_spec_files'
        from /Users/macbookowner/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.5/lib/rspec/core/command_line.rb:22:in `run'
        from /Users/macbookowner/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.5/lib/rspec/core/runner.rb:80:in `run'
        from /Users/macbookowner/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.5/lib/rspec/core/runner.rb:17:in `block in autorun'
    /Users/macbookowner/.rvm/rubies/ruby-1.9.3-p448/bin/ruby -S rspec /Users/macbookowner/Desktop/learn_ruby-master/00_hello/hello_spec.rb -I/Users/macbookowner/Desktop/learn_ruby-master/00_hello -I/Users/macbookowner/Desktop/learn_ruby-master/00_hello/solution -f documentation -r ./rspec_config failed
    fname-lnames-macbook-pro:00_hello macbookowner$ 

我的問題:出了什么問題? 我該如何解決?

信息:

  1. 運行rvm 1.9.3和rvm 2.0.0時出現相同/相似的錯誤
  2. 我在兩個rvm版本上都安裝了'gem install rspec'
  3. 我最好的猜測是rake找不到hello.rb文件(我在Sublime Text 2中創建,並保存在macbookowner-> Desktop中)。 在桌面上運行ls時,它確實顯示hello.rb。

提前致謝!

如果您查看錯誤,

/Users/macbookowner/Desktop/learn_ruby-master/00_hello/hello_spec.rb:116:in 'require': cannot load such file -- hello (LoadError) 

它表明在hello_spec.rb第116行中,有一條hello_spec.rb require 'hello'語句失敗。 該文件可能不存在於指定的路徑。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM