LoadError - cannot open shared object file - file is present, but it says no such file
Thanks to jordanm's comment, I was able to solve the issue!
The issue was related to openssl
. ldd
prints shared object dependencies and revealed the missing libraries.
ldd /usr/lib/ruby/2.3.0/x86_64-linux/openssl.so
...
libssl.so.1.0.0 => not found
libcrypto.so.1.0.0 => not found
...
After installing openssl-1.0
package, (while openssl
v1.1.0 package was installed), the output of the same command looks better:
libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0x00007faddac8f000)
libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x00007fadda814000)
and now, I'm able to require 'openssl'
as well as generating a new rails
project.
But after all, shouldn't ruby complain about missing packages, or should openssl-1.0
be at least a dependency of rails
?
libffi.so.6: cannot open shared object file in rails
Ubuntu 20.04 upgraded libffi6 to libffi7 but your Rails apps are still looking for libffi6.
You need to run the following command:
gem pristine ffi
This should fix it
cannot open shared object file: No such file or directory error while there is file
GCC's ld
command has an --rpath
option that may solve your problems:
-rpath=dir
Add a directory to the runtime library search path.
You should add the location of your compiled library to GCC's command line when you compile prog
, via the -wl
option:
-Wl,option
Pass option as an option to the linker. If option contains commas,
it is split into multiple options at the commas.
So your search path already includes /opt/lib
because of the original creation of the library:
-Wl,-rpath,/opt/lib
For the second compile, add the location of libctest.so.1.0
as another rpath
, and it should be found without your needing to move files around:
gcc -Wall -L/opt/lib main.c -lctest -Wl,-rpath,/you/dir/name -o prog
I think your original effort is failing as the linker has included a hard path to your original outout dir, and then you moved the library from under it.
libMagickCore.so.4: cannot open shared object file: No such file or directory
When you upgrade you can lose the reference to library file in a compiled gem. To resolve this just recompile the gem (the rmagick gem in this case). Depending on your server setup you can do this withgem pristine rmagick
orbundle exec gem pristine rmagick
when using bundler.
Related Topics
I Want to Return a Single Result Using .Find() with Ruby on Rails
Seahorse::Client::Networkingerror Amazon S3 File Upload with Rails
What Ruby Features Are Used in Chef Recipes
Rails Form_For Never Invokes the Create Controller Action to Use Redirect_To
Rspec - How to Test Activerecord::Recordnotfound
Ruby Project Help. Can't Get Saved Instances from Array
Access Image from Different View in a View with Paperclip Gem Ruby on Rails
Jekyll Custom Theme- Gemspec Bundle Install Error: Unexpected Unary-, Expecting Keyword_Do
How to Put a Raw SQL Query in Sequel
What Is a Very Simple Authentication Scheme for Sinatra/Rack
How to Know If an Io Is Empty Without Reading It
Can Ruby Tell If It Is Called from an Interactive Shell or Cron
Selenium Can't Find Fields with Type Number
How to Properly Create a Associated Record Just After the Associator Record Creation