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

Uncaught exception: libicudata.so.72: cannot open shared object file: No such file or directory #163

Open
apospielov opened this issue Jan 26, 2023 · 15 comments

Comments

@apospielov
Copy link

apospielov commented Jan 26, 2023

Trying to run my project on ubuntu 22. ruby 3.1.2
getting this:

Fast Debugger (ruby-debug-ide 3.0.0.beta.5, debase 3.0.0.beta.5, file filtering is supported, block breakpoints supported, smart steps supported, obtaining return values supported, partial obtaining of instance variables supported) listens on 0.0.0.0:34977
Uncaught exception: libicudata.so.72: cannot open shared object file: No such file or directory - /home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/charlock_holmes-0.7.7/lib/charlock_holmes/charlock_holmes.so
/home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/charlock_holmes-0.7.7/lib/charlock_holmes.rb:1:in require' /home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/charlock_holmes-0.7.7/lib/charlock_holmes.rb:1:in <top (required)>'
/home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/runtime.rb:60:in require' /home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/runtime.rb:60:in block (2 levels) in require'
/home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/runtime.rb:55:in each' /home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/runtime.rb:55:in block in require'
/home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/runtime.rb:44:in each' /home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler/runtime.rb:44:in require'
/home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.24/lib/bundler.rb:186:in require' /home/andrey/firstup/governor/config/application.rb:17:in <top (required)>'
/home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:137:in require' /home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:137:in block in perform'
internal:kernel:90:in tap' /home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:134:in perform'
/home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in run' /home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in invoke_command'
/home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in dispatch' /home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command/base.rb:87:in perform'
/home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command.rb:48:in invoke' /home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in <top (required)>'
/home/andrey/firstup/governor/bin/rails:4:in require' /home/andrey/firstup/governor/bin/rails:4:in <top (required)>'
/home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/debase-3.0.0.beta.5/lib/debase.rb:211:in load_protect' /home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/debase-3.0.0.beta.5/lib/debase.rb:211:in debug_load'

Process finished with exit code 0

the file /home/andrey/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/charlock_holmes-0.7.7/lib/charlock_holmes/charlock_holmes.so is present there.

How to fix?

@stanhu
Copy link
Contributor

stanhu commented Jan 30, 2023

I think you need to run gem pristine charlock_holmes. I suspect icu4c was upgraded by Homebrew. #164 attempts to avoid this problem by statically linking the libraries.

@stanhu
Copy link
Contributor

stanhu commented Jul 9, 2024

FYI, I published static_holmes with #164. You need to pass --enable-static in one of two ways:

gem install static_holmes -- --enable-static

Alternatively, add this to your Gemfile:

source 'https://rubygems.org'

gem 'static_holmes', '~> 0.7.11', require: 'charlock_holmes'
bundle config build.static_holmes "--enable-static"
bundle install

This only works with macOS out-of-the-box because most distributions (at least Ubuntu and Debian) don't ship with a static library compiled with -fPIC.

@mensfeld
Copy link

gem pristine charlock_holmes

ain't working on 22.04 0 as of now no idea how to make it work

@stanhu
Copy link
Contributor

stanhu commented Jul 18, 2024

@mensfeld What happens if you uninstall and install again?

gem uninstall charlock_holmes
gem install charlock_holmes

@mensfeld
Copy link

@stanhu same. I basically had to compile icu myself and move it to a proper location to make it work.

@stanhu
Copy link
Contributor

stanhu commented Jul 18, 2024

@mensfeld What errors are you seeing?

@mensfeld
Copy link

@stanhu I no longer see any because I compiled icu and moved it where charlock expected it but when I had it, I pretty much had the same complaint as the first person here (just for libicudata.so.73):

Uncaught exception: libicudata.so.73: cannot open shared object file: No such file or directory

My ubuntu 22.04 by default has icu up to 66. No idea how and why it wanted 73. Ubuntu 22.04 by default ain't shipped with such fresh one.

@stanhu
Copy link
Contributor

stanhu commented Jul 18, 2024

Strange. It sounds like charlock_holmes found libicudata.so.73 somewhere in your system at some point, and now it's gone.

@mensfeld
Copy link

@stanhu yeah I know. But I looked into the sources and apt references and I was not able to find any. I literally scanned my whole system for the so icu files. Nothing of that version. Reinstall, rebuild wasn't helping. What helped was me compiling the icu 73. Since I have a fix and it seems to be my machine specific oh well 🤷

FYI I have a second machine with ubuntu 20.04 (not 22.04) and there is no issue there.

@stanhu
Copy link
Contributor

stanhu commented Jul 19, 2024

@mensfeld I wonder if you had a .pc lying around that referenced version 73.

What does pkg-config --cflags --libs-only-l icu-i18n return?

@mensfeld
Copy link

pkg-config --cflags --libs-only-l icu-i18n
-I/home/mencio/.miniconda3/include -licui18n -licuuc -licudata

@stanhu
Copy link
Contributor

stanhu commented Jul 19, 2024

Oh, what about pkg-config --libs-only-L icu-i18n?

I wonder if this suggests you have a copy of ICU inside /home/mencio/.miniconda3. Perhaps some Python wheel installed a copy?

@mensfeld
Copy link

Hey @stanhu I'll check this for you tomorrow on this PC where it happened but this is possible. Since I installed icu 73 and problem went away it's hard for me to debug this further :(

@mensfeld
Copy link

pkg-config --libs-only-L icu-i18n
-L/home/user/.miniconda3/lib

yeah, but this dir does not exist 0_o

@stanhu
Copy link
Contributor

stanhu commented Jul 22, 2024

@mensfeld I think that means you still have a icu-i18n.pc in your system pointing to that path. Can you try running with the --debug flag?

pkg-config --libs-only-L icu-i18n --debug

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

3 participants