27

我在这里遇到循环错误:

Bundler::GemspecError: Could not read gem at /path/to/website/vendor/cache/ruby/2.1.0/cache/libv8-3.16.14.7-x86_64-darwin-14.gem. It may be corrupted.
An error occurred while installing libv8 (3.16.14.7), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.7'` succeeds before bundling.

$ gem install libv8 -v '3.16.14.7'

Successfully installed libv8-3.16.14.7-x86_64-darwin-14
/Users/snowcrash/.rvm/gems/ruby-2.1.5/gems/rdoc-4.0.1/lib/rdoc/markdown.rb:15931: warning: encountered \r in middle of line, treated as a mere space
Parsing documentation for libv8-3.16.14.7-x86_64-darwin-14
Done installing documentation for libv8 after 0 seconds
1 gem installed

$ bundle install --path vendor/cache
... many lines here ...
Using koala (1.10.1) 

Bundler::GemspecError: Could not read gem at /path/to/website/vendor/cache/ruby/2.1.0/cache/libv8-3.16.14.7-x86_64-darwin-14.gem. It may be corrupted.
An error occurred while installing libv8 (3.16.14.7), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.7'` succeeds before bundling.

有什么建议么?

==== 更新

我尝试删除所有缓存数据,rm -rf ~/.rvm/gems/ruby-2.1.5/cache/现在bundle install --path vendor/cache给了我:

Bundler::GemspecError: Could not read gem at /path/to/website/vendor/cache/ruby/2.1.0/cache/libv8-3.16.14.7-x86_64-darwin-14.gem. It may be corrupted.
An error occurred while installing libv8 (3.16.14.7), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.7'` succeeds before bundling.
4

5 回答 5

46

对于 MacOS Catalina 和 Big Sur:

brew install v8@3.15
bundle config build.libv8 --with-system-v8
bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
bundle

(根据需要更新版本号)

于 2020-06-16T16:17:02.740 回答
24

面对同样的问题,使用系统偏好安装 gem 对我有用

gem install libv8 -v '3.16.14.7' -- --with-system-v8
于 2019-03-27T10:49:30.160 回答
13

通常解决方案是将 libv8 更新到最新版本:

bundle update libv8

于 2016-08-17T18:30:54.793 回答
8

Run the following bundle config command then run bundle again

bundle config build.libv8 --with-system-v8
于 2020-07-15T10:44:07.457 回答
6

运行以下命令,然后再次运行捆绑安装。

rm ~/.rvm/gems/ruby-2.1.2/cache/libv8-3.16.14.7-x86_64-linux.gem
于 2015-01-30T19:13:09.297 回答