由于Bundler :: GemspecError导致bundle安装失败:无法读取gem at

时间:2014-12-11 05:23:11

标签: ruby-on-rails ruby rubygems rvm bundle

我在安装捆绑包时遇到这些错误:

 ✗ bundle install
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...

Bundler::GemspecError: Could not read gem at /Users/liuxin/.rvm/gems/ruby-1.9.3-p547/cache/i18n-0.6.11.gem. It may be corrupted.
An error occurred while installing i18n (0.6.11), and Bundler cannot continue.
Make sure that `gem install i18n -v '0.6.11'` succeeds before bundling.

✗ gem install i18n -v '0.6.11'
ERROR:  Error installing i18n:
    invalid gem: package metadata is missing in /Users/liuxin/.rvm/gems/ruby-1.9.3-p547/cache/i18n-0.6.11.gem

✗ rvm list

rvm rubies

=* ruby-1.9.3-p547 [ x86_64 ]
   ruby-2.1.2 [ x86_64 ]

1 个答案:

答案 0 :(得分:32)

似乎bundler去了gem的缓存,所以只需删除缓存的gem,然后再安装gem:

$ rm -f /Users/liuxin/.rvm/gems/ruby-1.9.3-p547/cache/i18n-0.6.11.gem
$ gem install i18n