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
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?