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

Sno*_*ash 6 bundler rvm libv8

我在这里得到一个循环错误:

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.
Run Code Online (Sandbox Code Playgroud)

有什么建议?

====更新

我尝试删除所有缓存数据,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.
Run Code Online (Sandbox Code Playgroud)

Dav*_*mpy 39

对于 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
Run Code Online (Sandbox Code Playgroud)

(根据需要更新版本号)

  • 感谢您提供 MACOS 解决方案! (2认同)
  • 太感谢了。我已经面对这个问题有一段时间了,并尝试了很多方法,终于找到了你的答案。它对大苏尔有帮助。 (2认同)

小智 22

面对同样的问题,使用系统首选项安装 gem 对我有用

gem install libv8 -v '3.16.14.7' -- --with-system-v8
Run Code Online (Sandbox Code Playgroud)

  • `--with-system-v8` 有什么作用?@SD (2认同)

Gui*_*ier 10

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

bundle update libv8


Fah*_*had 7

运行以下 bundle config 命令,然后再次运行 bundle

bundle config build.libv8 --with-system-v8
Run Code Online (Sandbox Code Playgroud)


Aje*_*han 6

运行以下命令,然后再次运行 bundle install。

rm ~/.rvm/gems/ruby-2.1.2/cache/libv8-3.16.14.7-x86_64-linux.gem
Run Code Online (Sandbox Code Playgroud)