【问题标题】:rake aborted - cannot load such file errorrake aborted - 无法加载此类文件错误
【发布时间】:2015-03-03 02:04:18
【问题描述】:

我最近将我的 Ruby 项目中的 Rspec Gem 从 2.12.0 升级到了 2.99.2。在我进行升级之前,一切正常,但是一旦我升级到 2.99.2 并运行我的规范测试之一,就会弹出“rake aborted - cannot load such file error”。错误消息说它无法加载 support/ext/vcr,这是我在 spec 文件中需要的另一个 rb 文件,你知道吗?

  rake aborted!

   cannot load such file -- support/ext/vcr



   (See full trace by running task with --trace)

 # ./spec/integration/resque_integration_spec.rb:31:in `rescue in wait_for'

 # ./spec/integration/resque_integration_spec.rb:22:in `wait_for'

 # ./spec/integration/resque_integration_spec.rb:77:in `block (2 levels) in <top (required)>'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/extensions/instance_eval_with_args.rb:16:in `instance_exec'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/extensions/instance_eval_with_args.rb:16:in `instance_eval_with_args'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/example.rb:116:in `block in run'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/example.rb:248:in `with_around_each_hooks'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/example.rb:113:in `run'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:515:in `block in run_examples'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:511:in `map'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:511:in `run_examples'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:496:in `run'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:24:in `block (2 levels) in run'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:24:in `map'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:24:in `block in run'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/reporter.rb:58:in `report'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:21:in `run'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:103:in `run'

 # /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:17:in `block in autorun'

【问题讨论】:

    标签: ruby-on-rails ruby rspec


    【解决方案1】:

    更新后,您应该始终重新启动您的开发环境。看看这样做有没有帮助。

    【讨论】:

    • 嗨科林,我重新启动了我的开发环境,但它仍然是同样的错误。我想知道从 2.12 到 2.14+ 是否有任何语法更改(例如不推荐使用的语法),因为此错误仅在升级到 2.14 或更高版本后发生。在 2.12 或 2.13 中,一切运行良好。
    • 嗨 Chris- 版本 2.99.x 肯定有弃用(请参阅提供的链接),但最糟糕的情况是您的系统会因为使用不推荐使用的方法而对您大喊大叫。在升级到 Rspec 3.x.x 版之前,您不会看到重大的重大更改。您会更新您的问题以提供更多代码上下文吗?很难从这样一个模棱两可的错误消息中知道发生了什么。这是 Rspec 更改的链接:rspec.info/blog/2013/11/…(已编辑以添加链接)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-20
    • 2014-09-15
    • 2021-04-08
    • 1970-01-01
    相关资源
    最近更新 更多