Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

LoadError libicudata.64.dylib with 0.7.7 #156

Open
OneDivZero opened this issue Sep 10, 2020 · 9 comments
Open

LoadError libicudata.64.dylib with 0.7.7 #156

OneDivZero opened this issue Sep 10, 2020 · 9 comments

Comments

@OneDivZero
Copy link

OneDivZero commented Sep 10, 2020

Installed as described in readme on latest OSX, installation passed without errors, but now rails does not work any more.

LoadError: dlopen(/Users/xxx/Projects/DTAG/td-wowi-shop-backend/vendor/bundle/ruby/2.5.0/gems/charlock_holmes-0.7.7/lib/charlock_holmes/charlock_holmes.bundle, 9): Library not loaded: /usr/local/opt/icu4c/lib/libicudata.64.dylib

Referenced from: /Users/xxx/Projects/DTAG/td-wowi-shop-backend/vendor/bundle/ruby/2.5.0/gems/charlock_holmes-0.7.7/lib/charlock_holmes/charlock_holmes.bundle

Reason: image not found - /Users/xxx/Projects/DTAG/td-wowi-shop-backend/vendor/bundle/ruby/2.5.0/gems/charlock_holmes-0.7.7/lib/charlock_holmes/charlock_holmes.bundle

@ivandenysov
Copy link

ivandenysov commented Mar 3, 2021

This might happen after you upgrade your icu4c. For example after brew upgrade. To fix it run bundle pristine charlock_holmes

I believe that this suggestion should be a part of the error message

@stanhu
Copy link
Contributor

stanhu commented Jan 30, 2023

This happens quite frequently to us. #164 would add an --enable-static option so that icu4c upgrades don't break charlock_holmes.

@stanhu
Copy link
Contributor

stanhu commented Jul 11, 2024

I think we can close this issue now that charlock_holmes 0.7.9 supports the --enable-static option:

gem install charlock_holmes -- --enable-static

This will work for macOS, but not for Debian/Ubuntu since they don't ship a static library compiled with -fPIC.

@MurapureddiNag
Copy link

MurapureddiNag commented Nov 7, 2024

If you’re having trouble installing charlock_holmes on an M3 Mac, try this:

Install a compatible ICU version:

brew install icu4c@74

Install the gem with the ICU path specified:

gem install charlock_holmes -v 0.7.7 -- --with-icu-dir=$(brew --prefix icu4c@74)

This links charlock_holmes to a compatible ICU version and should fix installation issues on Apple Silicon(Apple M3 Pro).

@KieranP
Copy link

KieranP commented Nov 10, 2024

Just ran into these issues after running brew upgrade. It installed icu4c@76, which evidently is not supported. Downgrading to @74 as per @MurapureddiNag comment above worked well. Thanks.

Also, --enable-static as mentioned earlier in this ticket does not work, so sticking with dynamic linking for now.

@stanhu
Copy link
Contributor

stanhu commented Nov 14, 2024

I've had no issues building charlock_holmes with icu4c@75 or icu4c@76 on Ruby 3.2.5. --enable-static also works fine.

What errors are you seeing?

@stanhu
Copy link
Contributor

stanhu commented Nov 14, 2024

It's entirely possible the issue I ran into with Go in golang/go#70209 is applicable here. The change in unicode-org/icu@199bc82 caused icu-uc to be in the Requires.private for libicu-i18n.pc:

Requires.private: icu-uc

We might need to add --static to the pkg-config command to pick up icu-uc.

However, I'm not seeing an issue:

% otool -L tmp/arm64-darwin23/stage/lib/charlock_holmes/charlock_holmes.bundle
tmp/arm64-darwin23/stage/lib/charlock_holmes/charlock_holmes.bundle:
	/Users/stanhu/.local/share/mise/installs/ruby/3.3.5/lib/libruby.3.3.dylib (compatibility version 3.3.0, current version 3.3.5)
	/opt/homebrew/opt/icu4c@76/lib/libicudata.76.dylib (compatibility version 76.0.0, current version 76.1.0)
	/opt/homebrew/opt/icu4c@76/lib/libicuuc.76.dylib (compatibility version 76.0.0, current version 76.1.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12)
	/opt/homebrew/opt/icu4c@76/lib/libicui18n.76.dylib (compatibility version 76.0.0, current version 76.1.0)
	/opt/homebrew/opt/icu4c@76/lib/libicuio.76.dylib (compatibility version 76.0.0, current version 76.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1800.101.0)

@stanhu
Copy link
Contributor

stanhu commented Nov 14, 2024

Actually, it seems charlock_holmes already adds all the required libraries here:

pkg_config("icu-i18n")
pkg_config("icu-io")
pkg_config("icu-uc")

That explains the latest version works fine for me. I don't know what errors people are getting.

@adolfopeccin
Copy link

This might happen after you upgrade your icu4c. For example after brew upgrade. To fix it run bundle pristine charlock_holmes

I believe that this suggestion should be a part of the error message

the bundle pristine charlock_holmes still the only solutions that works.

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

No branches or pull requests

6 participants