An error occurred while installing libv8 (3.16.14.7), and Bundler cannot continue
Asked Answered
P

5

32

I'm getting a cyclic error here:

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.

Any suggestions?

==== UPDATE

I tried deleting all cache data with rm -rf ~/.rvm/gems/ruby-2.1.5/cache/ and now bundle install --path vendor/cache gives me:

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.
Plasmo answered 10/1, 2015 at 10:17 Comment(0)
S
62

For MacOS Catalina, Big Sur, and Monterey:

brew install [email protected]
bundle config build.libv8 --with-system-v8
bundle config build.therubyracer --with-v8-dir=$(brew --prefix [email protected])
bundle

(update version numbers as needed)

Sapid answered 16/6, 2020 at 16:17 Comment(6)
Thanks, it works for Catalina when all the previous solutions failed.Ahq
I'm (newly) on Catalina, myself.Sapid
Thanks for MACOS solution!Shroyer
Thank you! I followed other instructions that executes gem install (i.e. gem install libv8 -v 'YOUR_VERSION' -- --with-system-v8 and gem install therubyracer -v 'YOUR_VERSION' -- --with-v8-dir=/usr/local/opt/[email protected]) and setting the bundle config build is key.Glossology
bundle config build.libv8 --with-system-v8 solved a problem in Ubuntu 20.10.Manard
thank you so much. I've been facing this issue for a while and tried many things and finally found your answer. It helped in Big sur.Exhibitor
P
31

Facing the same issue, install gem with system preferences worked for me

gem install libv8 -v '3.16.14.7' -- --with-system-v8
Pedaias answered 27/3, 2019 at 10:49 Comment(2)
What does --with-system-v8 do ? @PedaiasBiographical
I had to do this after upgrading to macos BigsurLeatherleaf
C
15

Usually the solution for this is updating libv8 to the latest version:

bundle update libv8

Cryptonymous answered 17/8, 2016 at 18:30 Comment(1)
This is the only one that did it for mePrevent
H
11

Run the following bundle config command then run bundle again

bundle config build.libv8 --with-system-v8
Houdini answered 15/7, 2020 at 10:44 Comment(0)
L
6

Run the following command than run the bundle install again.

rm ~/.rvm/gems/ruby-2.1.2/cache/libv8-3.16.14.7-x86_64-linux.gem
Lustreware answered 30/1, 2015 at 19:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.