我创建了一个新的 RoR 应用程序,但每当我运行 bundle install
(它与其他 gem 一起安装 RSpec)时,我都会收到以下错误:
Gem::Package::FormatError: no metadata found in /Users/petarpetrovic/.rvm/gems/ruby-1.9.3-p194/cache/selenium-webdriver-2.22.0.gem An error occured while installing selenium-webdriver (2.22.0), and Bundler cannot continue. Make sure that
gem install selenium-webdriver -v '2.22.0'
succeeds before bundling.
当我运行 gem install selenium-webdriver -v '2.22.0'
时,我收到以下错误消息:
ERROR: Error installing selenium-webdriver: invalid gem format for /Users/petarpetrovic/.rvm/gems/ruby-1.9.3-p194/cache/selenium-webdriver-2.22.0.gem
我尝试从缓存文件夹中手动删除 gem,然后重新运行 bundle install
但我仍然收到相同的错误消息。
有什么办法解决这个问题吗?
最佳答案
更新 gem
gem update --system
gem update
检查 Rails 应用程序中的 Gemfile。应内容:gem "selenium-webdriver", "~> 2.22.0"
再次运行bundle install
。
关于OS X Lion 上的 RubyGems 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10817451/