Gem Conflict在Sublime Text 2中运行测试 - RVM问题?

时间:2012-08-22 18:01:19

标签: ruby-on-rails-3 unit-testing rvm sublimetext2

我不太确定在我的设置中发生了什么变化,在Sublime Text 2中运行测试直到最近才工作......现在,当我在Sublime Text 2中运行Rspec测试时,我收到以下错误。

这对我来说就像一个RVM问题,因为我不久前创建了一个gemset。有什么想法吗?

这是错误:

/Users/brettsanders/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:31:in `block in setup': You have already activated spork 0.9.2, but your Gemfile requires spork 0.9.0. Using bundle exec may solve this. (Gem::LoadError)
    from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:17:in `setup'
    from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.1.3/lib/bundler.rb:107:in `setup'
    from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.1.3/lib/bundler/setup.rb:17:in `<top (required)>'
    from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
    from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /Users/brettsanders/rails_projects/sample_app/config/boot.rb:6:in `<top (required)>'
    from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/brettsanders/rails_projects/sample_app/config/application.rb:1:in `<top (required)>'
    from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/brettsanders/rails_projects/sample_app/config/environment.rb:2:in `<top (required)>'
    from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/brettsanders/rails_projects/sample_app/spec/spec_helper.rb:8:in `block in <top (required)>'
    from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0@rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork.rb:24:in `prefork'
    from /Users/brettsanders/rails_projects/sample_app/spec/spec_helper.rb:6:in `<top (required)>'
    from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/brettsanders/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/brettsanders/rails_projects/sample_app/spec/requests/static_pages_spec.rb:1:in `<top (required)>'
    from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0@rails3tutorial2ndEd/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load'
    from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0@rails3tutorial2ndEd/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `block in load_spec_files'
    from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0@rails3tutorial2ndEd/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `map'
    from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0@rails3tutorial2ndEd/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load_spec_files'
    from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0@rails3tutorial2ndEd/gems/rspec-core-2.10.1/lib/rspec/core/command_line.rb:22:in `run'
    from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0@rails3tutorial2ndEd/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:69:in `run'
    from /Users/brettsanders/.rvm/gems/ruby-1.9.3-p0@rails3tutorial2ndEd/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:10:in `block in autorun'
[Finished in 0.8s with exit code 1]

另外, 这是我的Gemfile

source 'https://rubygems.org'

gem 'rails', '3.2.8'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

group :development, :test do
  gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.10.0'
  gem 'guard-rspec', '0.5.5'
end


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.4'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier',     '1.2.3'
end

gem 'jquery-rails', '2.0.2'

group :test do
  gem 'capybara', '1.1.2'
  gem 'rb-fsevent', '0.4.3.1', :require => false
  gem 'growl', '1.0.3'
  gem 'guard-spork', '0.3.2'
  gem 'spork', '0.9.0'
end

group :production do
  gem 'pg', '0.12.2'
end

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

1 个答案:

答案 0 :(得分:0)

看起来你安装了0.9.2版本,而sublime文本试图使用

将GemFile中的spork版本更新为0.9.2或

gem uninstall spork

您将看到要删除的版本的选项,选择0.9.2

的版本