尝试运行ZenTest时,我一直收到此错误
Invalid gemspec in [/usr/local/rvm/gems/ruby-1.9.3-p194/specifications/ZenTest-4.9.3.gemspec]: Illformed requirement ["< 2.1, >= 1.8"].
我已经尝试删除ZenTest 4.9.3和gem安装ZenTest 4.8.3,但该版本无法在任何存储库中找到,因此它会自动安装ZenTest 4.9.3,这会导致错误,因此我无法运行spork或autotest。有没有办法解决?谢谢!
这是我的gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.11'
gem 'spork'
gem 'rspec-core'
gem 'autotest', '4.4.6'
gem 'autotest-rails', '4.1.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
gem 'sqlite3'
gem 'rspec-rails'
gem 'webrat'
gem 'capybara'
gem 'Zentest', '4.8.3'
end
group :production do
gem 'pg'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# 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'
答案 0 :(得分:10)
我遇到了同样的问题。挖掘后,我找到了解决方案。问题最可能出在系统中安装的RubyGems版本中。 (它将是<1.8.25)
直到该版本,RubyGems didn't roundtrip gemspecs properly因此无法正确解析“&lt; 2.1,&gt; = 1.8”。
所以,请完成以下步骤:
gem uninstall ZenTest
gem update --system
gem install ZenTest
问题应该解决,你不应再收到警告。