2013-02-26 105 views
0

我想設置我的ST2以便能夠從編輯器運行我的測試。當我點擊'Command'+'Shift'+'T'時,我不斷收到某種運行時錯誤。這是堆棧跟蹤。任何幫助,將不勝感激。Sublime Text 2 - RubyTest with ruby​​ 2.0 not working

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] 

回答

0

錯誤似乎很說明:

您已經激活了rspec的核心2.13.0,但你的Gemfile需要rspec的核心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' 
+0

我曾試圖更早。我得到'bundler:command not found:rspec-core'。 – jhamm 2013-02-26 14:14:06

+0

它是否響應bundle exec rspec-rails install(如果你有rspec-rails gem)?或者更一般地說,bundle exec gem install rspec? – 2013-02-26 14:38:51

+0

我在Gemfile中有'gem'rspec-rails','2.11.0''。運行'bundle install'時沒有錯誤。我假設rspec-core是這個rspec-rails gem的依賴項,那麼我將如何指定我想要的特定rspec-core。我確實像你說的那樣運行了gem install,它安裝了rpsec-2.13.0 gem。這並沒有解決我的問題。 – jhamm 2013-02-26 14:56:22