I built nginx with the module ngx_ruby https://github.com/rryqszq4/ngx_ruby . When I try nginx -V or start i’m recieving error: while loading shared libraries: libruby.so.2.3: cannot open shared object file: No such file or directory. In system installed rvm 1.29.12, ruby 2.3.8p459. The libruby.so.2.3 pathes is:
/usr/share/rvm/rubies/ruby-2.3.8/lib/libruby.so.2.3
/usr/share/rvm/src/ruby-2.3.8/libruby.so.2.3
/usr/local/rvm/rubies/ruby-2.3.8/lib/libruby.so.2.3
/usr/local/rvm/src/ruby-2.3.8/libruby.so.2.3
Nginx.conf:
http {
include mime.types;
default_type application/octet-stream;
set $RUBY_LIB "/usr/local/rvm/rubies/ruby-2.3.8/lib/libruby.so.2.3";
#servers configurations
location /content_by_ruby {
content_by_ruby "
time = Time.now
Ngx.print('Hello, Ngx_ruby! Current time: ' + time.inspect)
";
}
Nginx version 1.26.1, OS Ubuntu 24.04 LTS
ngx_ruby code was modified according to the instructions in firs comment here: C, nginx module compilation multiple definition error
I tried add set $RUBY_LIB “/usr/local/rvm/rubies/ruby-2.3.8/lib/libruby.so.2.3”; in conf, but it’s usefull, nginx can’t load any configs. Also, I reinstall rvm, install libruby2.3_2.3.8 from deb file. Looks like nginx searching libruby.so.2.3 in concret path.
1337 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.