Open mbajur opened 2 years ago
Hey @mbajur, please check out https://github.com/rubyjs/mini_racer#troubleshooting. I'm guessing you have to re-install (recompile) mini_racer and libv8-node.
If that means i just need to run gem uninstall --all mini_racer libv8-node
and bundle install
- it didn't helped :( (together with all the other steps)
hmm, I have no old macOS available. Any idea what that could be @lloeki?
Hmm, no I don't.
This is weird:
first eight bytes: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
These are the first bytes one is supposed to get (arm64, but anyway they should not be 0x00
at all):
$ od -xa tmp/arm64-darwin20/mini_racer_extension/3.0.2/mini_racer_extension.bundle | head -1
0000000 facf feed 000c 0100 0000 0000 0008 0000
I am getting same issues on Mac OS Big Sur when I run rake db:prepare
. Any work around?
This is my platform information
~% bundle platform
Your platform is: x86_64-darwin-20
Your app has gems that work on these platforms:
* arm64-darwin-21
* x86_64-darwin-19
* x86_64-darwin-20
* x86_64-linux
Your Gemfile specifies a Ruby version requirement:
* ruby 3.1.1p18
This is my gem version
% gem --version
3.3.11
There was an update to Xcode Command Line Utilities recently. Did you by any chance install this, @ianperera? This will update libraries that mini_racer is linking to. Make sure to run gem uninstall --all mini_racer libv8-node
.
There was an update to Xcode Command Line Utilities recently. Did you by any chance install this, @ianperera? This will update libraries that mini_racer is linking to. Make sure to run gem uninstall --all mini_racer libv8-node.
This is my gcc informations from xcode 13.2.1.
% gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
I have already tried to run this command gem uninstall --all mini_racer libv8-node
many times.
If you have the exact same problem, could you make sure that
/Users/USER/.rvm/gems/ruby-3.1.1/extensions/x86_64-darwin-20/3.1.0/mini_racer-0.6.2/mini_racer_extension.bundle
is removed when you uninstall the gems? I'm wondering if there are some leftover elsewhere, like build caches or something. I've never seen that issue before though, but I'm running out of ideas. Unfortunately I only have Monterey (macOS 12 / darwin21) around.
I was having the exact same problem on an Intel Mac running Big Sur, and all the suggestions given above eventually lead to the same error after the final bundle install && rails s
. The thing that finally fixed this was simply:
Makefile
(on my machine, this was /Users/samuel/.asdf/installs/ruby/2.6.9/lib/ruby/gems/2.6.0/gems/mini_racer-0.6.2/ext/mini_racer_extension
)make
manuallymini_racer_extension.bundle
over the old one in the proper directory (in my case, /Users/samuel/.asdf/installs/ruby/2.6.9/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-20/2.6.0/mini_racer-0.6.2
)After that, the gem seems to be working as expected.
I'm not sure what exactly is broken, but the mini_racer_extension.bundle
that gets installed after a bundle install
has a massive section of 0x00
s at the beginning, while the one that gets spit out after manually running make
has the proper header:
➜ hexdump -n4 mini_racer_extension.bundle
0000000 cf fa ed fe
I didn't bother investigating any deeper and I don't really have any knowledge on bundler
/gem
internals, but if I had to guess it seems like either some bad parameters are being passed to the make
invocation which is causing it to spit out a messed up binary, or the copy/install operation is somehow corrupting the beginning of the file.
It doesn't seem to be related to the Ruby version - OP says it works on 2.7.3 but breaks on 3.1.1, but I'm willing to bet a fresh rebuild on 2.7.3 would fail for him as well, since this is what happened to me on 2.6.9 (previous install was working, many months later I did a fresh reinstall and started getting the error). Also doesn't seem to be related to the version manager, since OP is using rvm
and I observed this with both rbenv
and asdf
.
Either way, hopefully this helps anyone else who stumbles upon this issue via search.
A lot has been updated and changed in the last 12 months. Could you give it another shot with the latest released mini_racer 0.8.0? I recently did some tests with Monterey and Ventura VMs using homebrew + rvm to get a fresh Ruby installation and was able to build mini_racer without any issues.
If you still encounter this issue, it would be helpful if you could provide the complete build logs.
-ping @samueldemoura @ianperera @mbajur
Hello,
i have an app I'm trying to upgrade from Ruby 2.7.3 to 3.1.1 and here is what's being raised after i try to run any command or start a server:
I was not able to google anything regarding such exception. I'm on macOS Big Sur + RVM. Please have in mind it works perfectly fine on 2.7.3
Thanks!