-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gem::Ext::BuildError: ERROR: Failed to build gem native extension #250
Comments
Get a very similar error on MacOS using gem. mini_racer searches for libv8 in |
I'm having the same problem, the problem is that it's trying to download the musl version instead of the standard x86_64 version
The README mentions adding the appropriate PLATFORM to Gemfile.lock https://github.com/rubyjs/mini_racer/pull/240/files But I've also added this:
This was discussed in this issue #218 but it's clearly causing issues for people. So I'm not sure how to fix this personally. |
Thanks a million @hananamar ! Ran into this tonight while deploying (to a staging server thankfully). I created the symlink for the dir as you did and it worked perfectly. You saved me hours! |
+1 here, also have issues installing. 0.4.0 installs just fine, but 0.6.2 wants to grab the musl version for some reason. Doing the symlink also works, but feels dirty (also not sustainable). I've also changed to PLATFORMS and I get the same issue:
|
I just got hit by this on local @lloeki , the bug in rubygems / bundler is really painful ... Our makefule looks for things in I wonder if we should add some internal workaround here where we put a symlink in place or add some lines to the makefile to fix it up? For people hitting this:
|
Yeah it's super painful when it happens. There's been additional work on the ruby gems repo to squash remaining corner cases. I thought about symlinks but they're problematic because when bundler fetches the incorrect one it would allow Ruby to find the libc-mismatched lib and result in very obscure errors. I've been thinking about doing things the way we did with sq_mini_racer:
This has the advantage of removing libv8-node from the bundle, thus reducing the overall bundle size, which is good since libv8-node is generally dead weight once mini_racer is compiled. The has the drawback of breaking the "fetching..." vs "installing..." expectation: the first one is downloading but executing no external code, the second one should build (and thus executes) but maybe never hit the network, which security wise means each step could theoretically be sandboxed with different capabilities. Maybe some do |
I am quite positive on just having the dependency removed in this way. I know it is not ideal cause we are stuck implementing bits of rubygems, but we would get far better control here which is nice. |
Alright I'll go this route and open a PR. |
By the way, rubygems/rubygems#5852 has been merged, fixing rubygems/rubygems#3174 right inside Rubygems. rubygems/rubygems#4488 is now a backport inside Bundler. |
Currently having the same issue. Sam's instructions weren't working in my docker-compose environment. And deployment is failing for me the same way. |
Updated bundler, have confirmed this issue is not happening on bundler 2.3.22. @hananamar (and any others) have you tried with newer bundler? |
All mentioned steps, including to update bundler, are in https://github.com/rubyjs/mini_racer/#troubleshooting. Especially with the latest round of fixes to bundler, I'm pretty confident that this will have solved a lot of the issues that were popping up over time. |
in my case, I had a similar issue in Centos 7. g++ version was "4.+" something and after upgrade g++ to "7.3.1". it worked! |
As state by the README (just over the Troubleshooting section):
I think, we're in a good spot with this one, so I'm closing this issue. |
I also ran into this issue on Fedora 36. We were storing our gems in
|
I have a rails app with
gem "mini_racer", '0.6.2', platforms: :ruby
in my Gemfile.When running
bundle install
I get the following error message:I checked the missing folder and indeed I found that the missing file form the libv8 gem was actually present in
/home/hanan/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/libv8-node-16.10.0.0-x86_64-linux-musl/vendor/v8/x86_64-linux-musl/libv8/obj/libv8_monolith.a
,as opposed to
/home/hanan/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/libv8-node-16.10.0.0-x86_64-linux-musl/vendor/v8/x86_64-linux/libv8/obj/libv8_monolith.a
which is where mini_racer is looking for it.I tried to add a symbolic link to point the missing directory to the existing one... and it worked.1
But this solution is not sustainable.
Footnotes
The command I used to add the symlink:
ln -s /home/hanan/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/libv8-node-16.10.0.0-x86_64-linux-musl/vendor/v8/x86_64-linux-musl /home/hanan/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/libv8-node-16.10.0.0-x86_64-linux-musl/vendor/v8/x86_64-linux
↩The text was updated successfully, but these errors were encountered: