0

我是一个菜鸟,正在学习这里很多人可能知道的教程(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。

提前致谢!

4

1 回答 1

0

如果您查看错误,

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

它显示hello_spec.rb在第 116 行,有一条require 'hello'语句失败。该文件可能在指定的路径中不存在。

于 2013-09-28T22:31:26.713 回答