Skip to content
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

dyld: Symbol not found: __ZN2v82V813InitializeICUEPKc #185

Closed
Overload119 opened this issue Jan 17, 2021 · 21 comments
Closed

dyld: Symbol not found: __ZN2v82V813InitializeICUEPKc #185

Overload119 opened this issue Jan 17, 2021 · 21 comments

Comments

@Overload119
Copy link

This occurs when server-rendering from React component.
The gem install command actually works fine.

Any idea what I can do here to debug?

dyld: Symbol not found: __ZN2v82V813InitializeICUEPKc
 Referenced from: /Users/jackmilton/.rvm/gems/ruby-2.7.2/gems/mini_racer-0.3.1/lib/mini_racer_extension.bundle
 Expected in: flat namespace
@valscion
Copy link

valscion commented Jan 18, 2021

Could this be a duplicate of #169?

@Overload119
Copy link
Author

This is on Mac OSX so it doesn't seem to be the case.

@3wille
Copy link

3wille commented Jan 29, 2021

I am getting the same error on Mac OSX with an M1 chip (arm64). I also tried ruby 2.7.0 and 2.6.6 und tried installing mini_racer and libv8 as x86_64 with arch -x86_64 bundle install but had no luck

@sweetppro
Copy link

I had this issue as well with my Rails 6.1.1 Install on Apple Silicon.
I managed to get it fixed by updated to a beta version of mini_racer, and also updating Ruby to v2.7.2.

here's the relevant thread:
rubyjs/libv8-node#14

and the beta build for your Gem file:

# Gemfile
gem 'mini_racer', github: 'rubyjs/mini_racer', branch: 'refs/pull/186/head'
# or
gem 'mini_racer', github: 'sqreen/mini_racer', branch: 'use-libv8-node'

@tisba
Copy link
Collaborator

tisba commented May 31, 2021

Is the issue still resolved for you, @sweetppro using the latest released version of mini_racer?

@sweetppro
Copy link

Is the issue still resolved for you, @sweetppro using the latest released version of mini_racer?

yup I'm running mini_racer (0.4.0) without any issues

@tisba
Copy link
Collaborator

tisba commented Jan 17, 2022

There have been a ton of updates/fixes with current mini_racer versions. Can you check if the current 0.6.2 solves your issue, @Overload119?

@Overload119
Copy link
Author

No longer can reproduce.

@scruff311
Copy link

@tisba I found this thread because I've been fighting this same issue for 2 days on version 0.6.2 using an Intel Macbook Pro OSX Big Sur and more recently Monterey. The error I was getting on Monterey when attempting to start a rails server was

1: from /Users/kevin/.rvm/gems/ruby-2.7.5/gems/mini_racer-0.6.2/lib/mini_racer.rb:11:in `<main>'
/Users/kevin/.rvm/gems/ruby-2.7.5/gems/mini_racer-0.6.2/lib/mini_racer.rb:11:in `load': dlopen(/Users/kevin/.rvm/gems/ruby-2.7.5/extensions/x86_64-darwin-20/2.7.0/mini_racer-0.6.2/mini_racer_extension.bundle, 0x0005): symbol not found in flat namespace '__ZN2v811ArrayBuffer9Allocator19NewDefaultAllocatorEv' (LoadError)

Because @sweetppro said 0.4.0 worked for him I figured I would give that a shot

Is the issue still resolved for you, @sweetppro using the latest released version of mini_racer?

yup I'm running mini_racer (0.4.0) without any issues

I'm finally able to run my rails app again using mini_racer 0.4.0 where I could not on 0.6.2.

@tisba
Copy link
Collaborator

tisba commented Jan 27, 2022

@scruff311 that's really odd. I'm on Monetery 12.1 (intel/x86), also using RVM like you and with Ruby 2.7.5, mini_racer 0.6.2 and libv8-node 16.10.0.0 it just works.

Can you tell us some more about your environment?

  • Ruby: ruby --version (for me ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-darwin21])
  • Rubygems: gem --version (for me 3.1.6)
  • GCC: gcc --version (for me Apple clang version 13.0.0 (clang-1300.0.29.30))
  • gem list libv8-node mini_racer

The only thing I can think of at this time is to re-install mini_racer and libv8-node. If that doesn't help I'm lost /cc @SamSaffron

@scruff311
Copy link

@tisba here is the output i get for those commands

(base) kevins-mbp:bin kevin$ ruby --version
ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-darwin20]
(base) kevins-mbp:bin kevin$ gem --version
3.1.6
(base) kevins-mbp:bin kevin$ 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-darwin21.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
(base) kevins-mbp:bin kevin$ gem list libv8-node mini_racer

*** LOCAL GEMS ***

libv8-node (16.10.0.0 ruby x86_64-darwin, 15.14.0.1 x86_64-darwin-20)

*** LOCAL GEMS ***

mini_racer (0.4.0)
sq_mini_racer (0.3.1.0.6)

@tisba
Copy link
Collaborator

tisba commented Jan 27, 2022

It's a stretch, but could you remove all versions of mini_racer and libv8-node and try 0.6.2 again? Just want to make 100% sure that not the wrong version of libv8-node gets picked up during compilation of mini_racer.

@tisba
Copy link
Collaborator

tisba commented Jan 27, 2022

I noticed something else: Your ruby --version states x86_64-darwin20 as platform, but gcc says x86_64-apple-darwin21.3.0. Did you build 2.7.5 from source? maybe on an earlier version of macOS?

@scruff311
Copy link

🤯 i uninstalled mini_racer, libv8-node and sq_mini_racer and then reinstalled them and amazingly it now works with 0.6.2. I had uninstalled mini_racer countless times, but i guess i never also uninstalled libv8-node at the same time.

To answer your question, my Ruby 2.7.5 was installed with RVM when my mac was still on Big Sur (darwin-20). I have since updated to Monterey (darwin-21).

Thanks for your help!

@tisba
Copy link
Collaborator

tisba commented Jan 28, 2022

Awesome! 🎉

I'm collecting these kinds of issues currently to compile a troubleshooting guide. This platform difference is an important piece of it!

@cjoulain
Copy link

cjoulain commented Feb 8, 2022

Thank you for documenting these steps, @scruff311. I tried what you did (I was only uninstalling mini_racer) and was able to get my local working again.

@cjoulain
Copy link

@tisba When I run my local Rails server, I encounter this:

/Users/cj/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/mini_racer-0.6.2/lib/mini_racer.rb:11:in `load': dlopen(/Users/cj/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/extensions/arm64-darwin-21/3.1.0/mini_racer-0.6.2/mini_racer_extension.bundle, 0x0005): symbol not found in flat namespace '__ZN2v811ArrayBuffer9Allocator19NewDefaultAllocatorEv' (LoadError)

I previously encountered this error while upgrading to Ruby 3.0.0 last month. I've just upgraded to Ruby 3.1.1. I was able to clear up this issue last time by uninstalling mini_racer and libv8-node at the same time. However, it didn't work this time around.

Any tips?

My specs:

ruby --version
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [arm64-darwin21]

gem --version
3.3.7

gcc --version
Apple clang version 13.1.6 (clang-1316.0.21.2)
Target: arm64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

gem list libv8-node mini_racer


*** LOCAL GEMS ***

libv8-node (16.10.0.0 ruby arm64-darwin)

*** LOCAL GEMS ***

mini_racer (0.6.2

@tisba
Copy link
Collaborator

tisba commented Mar 16, 2022

@cjoulain are you 100% certain that you've compiled Ruby, mini_racer and/or libv8-node on your current macOS (12.3 I would guess based on gcc --version). Any cases I know of for these errors are related to OS upgrades.

@cjoulain
Copy link

Thanks for checking in, @tisba. I had to uninstall and reinstall almost 10 times for my repo to work again. I can't say what helped -- it working again was arbitrary. But I did compile all three. Since you mention it's OS-related, I won't reach out here if it happens again.

@tisba
Copy link
Collaborator

tisba commented Apr 12, 2022

I'm running out of ideas then :(

Is there some way to further analyse what's going on here, @SamSaffron/@lloeki?

@Saya221
Copy link

Saya221 commented Dec 5, 2023

In my case, I resolved the issue by updating my clang++, clang, c++, gcc, and g++ on macOS to Apple Clang. Here's the setup for g++, gcc, and c++ in .bashrc or .zshrc files. Please ensure these lines are placed at the beginning of file:

# C++, Clang++, G++, GCC
export CXX=/usr/bin/clang++
export CC=/usr/bin/clang

# Adjust PATH to prioritize /usr/bin
export PATH="/usr/bin:$PATH"

After making these changes, check the versions of the following:

gcc -v
g++ -v
c++ -v
clang -v
clang++ -v
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Ensure that the versions match Apple Clang, as this error is likely caused by our compilation. Finally, restart machine, reinstall mini_racer, and it should work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants