brianmario / charlock_holmes

Character encoding detection, brought to you by ICU
MIT License
1.03k stars 140 forks source link

LoadError libicudata.64.dylib with 0.7.7 #156

Open OneDivZero opened 3 years ago

OneDivZero commented 3 years ago

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 commented 3 years ago

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 commented 1 year ago

This happens quite frequently to us. https://github.com/brianmario/charlock_holmes/pull/164 would add an --enable-static option so that icu4c upgrades don't break charlock_holmes.

stanhu commented 1 week ago

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.