Sublime Text 2 - RubyTest与ruby 2.0无法正常工作

时间:2013-02-26 11:45:35

标签: ruby-on-rails-3 sublimetext2 ruby-2.0 ruby-test

我正在尝试设置我的ST2以便能够从编辑器运行我的测试。当我点击'Command'+'Shift'+'T'时,我会遇到某种运行时错误。这是堆栈跟踪。任何帮助将不胜感激。

No DRb server is running. Running in local process instead ...
/Users/susiehamm/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.0.pre.2/lib/bundler/runtime.rb:31:in `block in setup': You have already activated rspec-core 2.13.0, but your Gemfile requires rspec-core 2.11.1. Using bundle exec may solve this. (Gem::LoadError)
    from /Users/susiehamm/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.0.pre.2/lib/bundler/runtime.rb:17:in `setup'
    from /Users/susiehamm/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.0.pre.2/lib/bundler.rb:117:in `setup'
    from /Users/susiehamm/.rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.0.pre.2/lib/bundler/setup.rb:17:in `<top (required)>'
    from /Users/susiehamm/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require'
    from /Users/susiehamm/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
    from /Users/susiehamm/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
    from /Users/susiehamm/Documents/Rails/sample_app/config/boot.rb:6:in `<top (required)>'
    from /Users/susiehamm/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/susiehamm/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/susiehamm/Documents/Rails/sample_app/config/application.rb:1:in `<top (required)>'
    from /Users/susiehamm/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/susiehamm/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/susiehamm/Documents/Rails/sample_app/config/environment.rb:2:in `<top (required)>'
    from /Users/susiehamm/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/susiehamm/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/susiehamm/Documents/Rails/sample_app/spec/spec_helper.rb:10:in `block in <top (required)>'
    from /Users/susiehamm/.rvm/gems/ruby-2.0.0-p0/gems/spork-0.9.2/lib/spork.rb:24:in `prefork'
    from /Users/susiehamm/Documents/Rails/sample_app/spec/spec_helper.rb:4:in `<top (required)>'
    from /Users/susiehamm/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/susiehamm/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/susiehamm/Documents/Rails/sample_app/spec/requests/static_pages_spec.rb:1:in `<top (required)>'
    from /Users/susiehamm/.rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.13.0/lib/rspec/core/configuration.rb:819:in `load'
    from /Users/susiehamm/.rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.13.0/lib/rspec/core/configuration.rb:819:in `block in load_spec_files'
    from /Users/susiehamm/.rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.13.0/lib/rspec/core/configuration.rb:819:in `each'
    from /Users/susiehamm/.rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.13.0/lib/rspec/core/configuration.rb:819:in `load_spec_files'
    from /Users/susiehamm/.rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.13.0/lib/rspec/core/command_line.rb:22:in `run'
    from /Users/susiehamm/.rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.13.0/lib/rspec/core/runner.rb:77:in `rescue in run'
    from /Users/susiehamm/.rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.13.0/lib/rspec/core/runner.rb:73:in `run'
    from /Users/susiehamm/.rvm/gems/ruby-2.0.0-p0/gems/rspec-core-2.13.0/lib/rspec/core/runner.rb:17:in `block in autorun'
[Finished in 0.8s with exit code 1]

1 个答案:

答案 0 :(得分:0)

错误似乎很明显:

  

您已经激活了rspec-core 2.13.0,但您的Gemfile需要rspec-core 2.11.1。使用bundle exec可以解决这个问题。 (GEM :: LoadError)

调整rspec-rails的版本(包含rspec-core)或使用bundle exec运行。

解决方案:

在您的gemfile中,更改:

gem 'rspec-rails', '2.11.0' 

要:

gem 'rspec rails', '2.13.0'