起因
apt-get install ruby
root@ddfe91f8ec33:/home/coder# ruby
ruby: error while loading shared libraries: libruby-2.5.so.2.5: cannot open shared object file: Error 40
排查
apt-get install libruby
尝试安装动态库,发现已经安装
创建动态库缓存
root@ddfe91f8ec33:/home/coder# /sbin/ldconfig -v|grep libruby-2.5.so.2.5.5
/sbin/ldconfig: Can't stat /usr/local/lib/x86_64-linux-gnu: No such file or directory
/sbin/ldconfig: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig: Path `/usr/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig: /lib/x86_64-linux-gnu/ld-2.28.so is the dynamic linker, ignoring
libruby-2.5.so.2.5 -> libruby-2.5.so.2.5.5
动态库缓存成功,此时再运行ruby成功