How to fix libv8 “bad version” error when using mini_racer

Photo by Sarah Kilian on Unsplash

TL;DR

Run

The Issue I Experienced

I’ve been dealing with issues on my Mac for a while, so yesterday I decided to give in and wipe it. I upgraded to MacOS Catalina, then wiped my partition and did a fresh install.

In a few hours, I had almost everything running. Today, I tried to run to setup a Rails project's dependencies and I was greeted by this:

Error: Command 'cipd ensure -log-level error -root
/Users/brandoncc/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-6.7.288.46.1/vendor
-ensure-file /var/folders/9l/2jz0cz8x56nbz806ty1fwwkh0000gn/T/tmpDPKTcT.ensure'
returned non-zero exit status 1
**\_\_\_\_** running 'cipd ensure -log-level error -root
/Users/brandoncc/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-6.7.288.46.1/vendor
-ensure-file /var/folders/9l/2jz0cz8x56nbz806ty1fwwkh0000gn/T/tmpDPKTcT.ensure'
in '.'
Error: failed to resolve package version (line 5): bad version (not an instance
ID, a ref or a tag): "M56jPzDv1620Rnm\_\_jTMYS62Zi8rxHVq7yw0qeBFEgkC".
Running: gclient root
Running: gclient config --spec 'solutions = [
{
"url": "https://chromium.googlesource.com/v8/v8.git",
"managed": False,
"name": "v8",
"deps_file": "DEPS",
"custom_deps": {},
},
]
'
Running: gclient sync --with_branch_heads
Traceback (most recent call last):
File
"/Users/brandoncc/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-6.7.288.46.1/vendor/depot_tools/fetch.py",
line 306, in <module>
sys.exit(main())
File
"/Users/brandoncc/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-6.7.288.46.1/vendor/depot_tools/fetch.py",
line 301, in main
return run(options, spec, root)
File
"/Users/brandoncc/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-6.7.288.46.1/vendor/depot_tools/fetch.py",
line 295, in run
return checkout.init()
File
"/Users/brandoncc/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-6.7.288.46.1/vendor/depot_tools/fetch.py",
line 137, in init
self.run_gclient(\*sync_cmd)
File
"/Users/brandoncc/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-6.7.288.46.1/vendor/depot_tools/fetch.py",
line 82, in run_gclient
return self.run(cmd_prefix + cmd, **kwargs)
File
"/Users/brandoncc/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-6.7.288.46.1/vendor/depot_tools/fetch.py",
line 71, in run
subprocess.check_call(cmd, **kwargs)
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py",
line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('gclient', 'sync',
'--with_branch_heads')' returned non-zero exit status 1
/Users/brandoncc/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8-6.7.288.46.1/ext/libv8/builder.rb:79:in
`block in setup_build_deps!': unable to fetch v8 source (RuntimeError)

There are two important lines here:

Error: failed to resolve package version (line 5): bad version (not an instance ID, a ref or a tag): “M56jPzDv1620Rnm__jTMYS62Zi8rxHVq7yw0qeBFEgkC”.

and

/Users/brandoncc/.rbenv/versions/2.5.7/lib/ruby/gems/2.5.0/gems/libv8–6.7.288.46.1/ext/libv8/builder.rb:79:in `block in setup_build_deps!’: unable to fetch v8 source (RuntimeError)

I tried every solution I could find for libv8 not compiling on a Mac. Most of them looked a lot like this one:

The Solution

Nothing I did resolved my issue…until I found my way to this comment, which made me wonder if needed to be updated in order to be compatible with MacOS Catalina.

I ran , and sure enough... my bundle installed!

Thank You, Friend

Thanks for stopping by, I really hope this helped you!

Originally published at https://brandoncc.dev.