我无法让rubymine运行我的测试,即使它们在命令行上工作正常。升级一些宝石之后似乎已经开始出现这些问题了。当我按下ctrl + shft + F10时,我得到了这个:
/Users/williamjeffries/.rbenv/shims/bundle exec /Users/williamjeffries/.rbenv/versions/2.2.3/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/williamjeffries/code/myr-admin/bin/spring rspec /Users/williamjeffries/code/myr-admin/spec/controllers/orders_controller_spec.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter --example "OrdersController a single order a credit card order captured order"
Testing started at 6:08 PM ...
/Users/williamjeffries/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.13.1/lib/bundler/definition.rb:181:in `rescue in specs': Your bundle is locked to rake (12.0.0), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of rake (12.0.0) has removed it. You'll need to update your bundle to a different version of rake (12.0.0) that hasn't been removed in order to install. (Bundler::GemNotFound)
from /Users/williamjeffries/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.13.1/lib/bundler/definition.rb:175:in `specs'
from /Users/williamjeffries/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.13.1/lib/bundler/definition.rb:235:in `specs_for'
from /Users/williamjeffries/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.13.1/lib/bundler/definition.rb:224:in `requested_specs'
from /Users/williamjeffries/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.13.1/lib/bundler/runtime.rb:118:in `block in definition_method'
from /Users/williamjeffries/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.13.1/lib/bundler/runtime.rb:19:in `setup'
from /Users/williamjeffries/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.13.1/lib/bundler.rb:99:in `setup'
from /Users/williamjeffries/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.13.1/lib/bundler/setup.rb:20:in `<top (required)>'
from /Users/williamjeffries/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/williamjeffries/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
Process finished with exit code 1
似乎我认为我没有rake 12.0.0,但gem list rake
显示我这样做:
$ gem list rake
*** LOCAL GEMS ***
rake (12.0.0, 11.2.2, 10.4.2)
我仔细检查过,在发布时,12.0.0实际上既是有效版本又是rake的最新稳定版本:https://github.com/ruby/rake/releases
为什么这可能会失败以及如何让RubyMine再次成功运行我的测试?
答案 0 :(得分:1)
解决方案是重启RubyMine。