Hi,
We
currently use open-source Passenger (installed as a gem) with NGINX. There are two
Rails apps running on two different Ruby (1.9.3 and 2.2.2) with RVM support.
One rails app (on 1.9.3 ruby) runs fine, but another one (on 2.2.2 Ruby) throws the following error into the passenger log:
stderr: --> Compiling passenger_native_support.so for the current Ruby interpreter...
stderr:
stderr: (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
stderr:
stderr: Warning: compilation didn't succeed. To learn why, read this file:
stderr: /tmp/passenger_native_support-1q8ot9n.log
stderr: --> Downloading precompiled passenger_native_support.so for the current Ruby interpreter...
stderr: (set PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY=0 to disable)
stderr: Could not download https://oss-binaries.phusionpassenger.com/binaries/passenger/by_release/5.0.21/rubyext-ruby-2.2.2-x86_64-linux.tar.z: The requested URL returned error: 404 Not Found
stderr: Trying next mirror...
stderr: Could not download https://s3.amazonaws.com/phusion-passenger/binaries/passenger/by_release/5.0.21/rubyext-ruby-2.2.2-x86_64-linux.targz: The requested URL returned error: 403 Forbidden
stderr: --> Continuing without passenger_native_support.so.
I’ve tried manually to compile passenger_native_support for the 2.2.2 Ruby with the commands:
rvm use 2.2.2
ruby /home/webadmin/.rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.21/bin/passenger-config build-native-support
But no luck. :-(
Please, advise how to get the passenger_native_support for the 2.2.2 Ruby.
Thanks in
advance.
P.S. In any case I give related log data:
/tmp/passenger_native_support-1q8ot9n.log
# mkdir -p /home/webadmin/.rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.21/buildout/ruby/ruby-2.2.2-x86_64-linux
Encountered permission error, trying a different directory...
-------------------------------
# mkdir -p /home/webadmin/.passenger/native_support/5.0.21/ruby-2.2.2-x86_64-linux
# cd /home/webadmin/.passenger/native_support/5.0.21/ruby-2.2.2-x86_64-linux
# /home/webadmin/.rvm/gems/ruby-2.2.2@herba_mycity/wrappers/ruby /home/webadmin/.rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.21/src/ruby_native_extension/extconf.rb
checking for alloca.h... *** /home/webadmin/.rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.21/src/ruby_native_extension/extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=/home/webadmin/.rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.21/src/ruby_native_extension
--curdir
--ruby=/home/webadmin/.rvm/rubies/ruby-2.2.2/bin/$(RUBY_BASE_NAME)
/home/webadmin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /home/webadmin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:587:in `try_cpp'
from /home/webadmin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:1060:in `block in have_header'
from /home/webadmin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
from /home/webadmin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /home/webadmin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from /home/webadmin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
from /home/webadmin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from /home/webadmin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
from /home/webadmin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
from /home/webadmin/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:1059:in `have_header'
from /home/webadmin/.rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.21/src/ruby_native_extension/extconf.rb:38:in `<main>'
"gcc -o conftest -I/home/webadmin/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/x86_64-linux -I/home/webadmin/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0/ruby/backward -I/home/webadmin/.rvm/rubies/ruby-2.2.2/include/ruby-2.2.0 -I/home/webadmin/.rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.21/src/ruby_native_extension -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -fPIC -g conftest.c -L. -L/home/webadmin/.rvm/rubies/ruby-2.2.2/lib -Wl,-R/home/webadmin/.rvm/rubies/ruby-2.2.2/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-rpath,'/../lib' -Wl,-R'/../lib' -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc"
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
sudo apt-get install libgmp3-dev
Disconnecting long-running connections for process …
...
http {
passenger_root /home/webadmin/.rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.21;
passenger_log_file /u/apps/passenger.log;
passenger_pool_idle_time 0;
...
And even after NGINX restarting it has no effect on the situation.
App 23060 stdout:
[ 2016-08-28 17:36:44.8355 22569/7fe699e5a700 age/Cor/CoreMain.cpp:819 ]: Checking whether to disconnect long-running connections for process 22961, application /u/apps/example/current/public
App 23084 stdout:
user webadmin;
worker_processes 6;
events {
worker_connections 1024;
}
http {
passenger_root /home/webadmin/.rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.30;
passenger_ruby /home/webadmin/.rvm/gems/ruby-1.9.3-p551/wrappers/ruby;
passenger_log_file /u/apps/passenger.log;
passenger_pool_idle_time 0;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
...
server {
listen 443 ssl;
server_name speakers.example.ru;
ssl_certificate /home/webadmin/ssl/example.chained.crt;
ssl_certificate_key /home/webadmin/ssl/example.key;
error_log /u/apps/example/shared/log/nginx.error.log;
access_log /u/apps/example/shared/log/nginx.access.log; #charset koi8-r;
root /u/apps/example/current/public;
passenger_ruby /home/webadmin/.rvm/gems/ruby-2.2.2@example/wrappers/ruby;
passenger_enabled on;
}
...
}
Upgrading to 5.0.30 is a good first step, continuing to use the gem is fine.
Cam