2

尝试运行 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。有没有办法解决?谢谢!

这是我的宝石文件:

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'
4

1 回答 1

10

我有同样的问题。挖掘后,我找到了解决方案。问题很可能与系统中安装的 RubyGems 版本有关。(这将是 <1.8.25)

在那个版本之前,RubyGems没有正确地往返 gemspecs,因此无法正确解析 "< 2.1, >= 1.8"。

因此,请执行以下步骤:

gem uninstall ZenTest
gem update --system
gem install ZenTest

问题应该得到解决,您应该不再收到警告。

于 2013-08-22T19:57:26.300 回答