安装libv8(3.11.8.13)时发生错误,Bundler无法继续

Jea*_*ean 5 ruby rubygems ruby-on-rails-3.2

运行捆绑安装后,我收到此错误:

Gem::Package::FormatError: no metadata found in /Users/jeanosorio/.rvm/gems/ruby-1.9.3-p286/cache/libv8-3.11.8.13-x86_64-darwin-12.gem
An error occurred while installing libv8 (3.11.8.13), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.11.8.13'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)

我试着用

gem install libv8 -v '3.11.8.13'
Run Code Online (Sandbox Code Playgroud)

但我明白了

ERROR:  Error installing libv8:
    invalid gem format for /Users/jeanosorio/.rvm/gems/ruby-1.9.3-p286/cache/libv8-3.11.8.13-x86_64-darwin-12.gem
Run Code Online (Sandbox Code Playgroud)

这里有什么问题.请帮忙.

Pra*_*thy 9

Gem::Package::FormatError: no metadata found in ...错误信息表明,Ruby的缓存目录的内容变得不同步与实际宝石库.

可以通过删除有问题的文件或完整的缓存文件夹并bundle install再次运行来修复错误.

首先尝试删除有问题的文件:

rm ~/.rvm/gems/ruby-1.9.3-p286/cache/libv8-3.11.8.13-x86_64-darwin-12.gem
bundle install
Run Code Online (Sandbox Code Playgroud)

这应该解决问题.如果没有,请删除完整的缓存文件夹:

 rm -rf ~/.rvm/gems/ruby-1.9.3-p286/cache/
 bundle install
Run Code Online (Sandbox Code Playgroud)

参考:

  1. Rails:修复捆绑"找不到元数据"问题
  2. Bundler问题:未找到元数据
  3. 所以回答 RubyGems issue on OSX

此外,gem update --system本答案中所述,可能值得更新rubygems版本