LoadError - cannot open shared object file - file is present, but it says no such file

后端 未结 1 626
谎友^
谎友^ 2021-01-24 12:48

Ruby comes up with LoadErrors I do not understand. It complains about opening a shared object file, while it\'s present.

irb(main):001:0> require         


        
相关标签:
1条回答
  • 2021-01-24 13:24

    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?

    0 讨论(0)
提交回复
热议问题