简体   繁体   中英

Compile Passenger Native Support with RVM for different Ruby versions

Clean installation on CentOS 7.

Installed RVM in ~/.rvm as new user Passenger

All sites hosted are owned by Apache user

Installed RVM with 2 rubies:

  • 1.9.3-p551 (default)
  • 2.3.0

I installed and compiled Passenger as a gem in the default Ruby 1.9.3.

However, I keep getting these entries in my /var/log/httpd/error_log on the sites that use Ruby 2.3.0:

App 12909 stdout:
App 12909 stderr:  [passenger_native_support.so] trying to compile for the current user (apache) and Ruby interpreter...
App 12909 stderr:      (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
App 12909 stderr:      Warning: compilation didn't succeed. To learn why, read this file:
App 12909 stderr:      /tmp/passenger_native_support-bqcp0n.log
App 12909 stderr:  [passenger_native_support.so] finding downloads for the current Ruby interpreter...
App 12909 stderr:
App 12909 stderr:      (set PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY=0 to disable)
App 12909 stderr:      Could not download https://oss-binaries.phusionpassenger.com/binaries/passenger/by_release/5.0.26/rubyext-ruby-2.3.0-x86_64-linux.tar.gz: The requested URL returned error: 404 Not Found
App 12909 stderr:      Trying next mirror...
App 12909 stderr:      Could not download https://s3.amazonaws.com/phusion-passenger/binaries/passenger/by_release/5.0.26/rubyext-ruby-2.3.0-x86_64-linux.tar.gz: The requested URL returned error: 403 Forbidden
App 12909 stderr:  [passenger_native_support.so] will not be used (can't compile or download)
App 12909 stderr:   --> Passenger will still operate normally.

Now, normally you would simply run passenger-config build-native-support but this obviously only works for the Ruby environment where the Passenger gem is built in (= 1.9.3).

How do I build this native support for ALL RVM installed versions and make this error go away?

Simple run 'passenger-config build-native-support' using the Ruby you wish to compile for.

For example:

rvm use 2.3.0
ruby /path-to-passenger-config build-native-support

Passenger doesn't care which Ruby you used to install Passenger. You can use Passenger with any Ruby, no matter which Ruby you used to install Passenger. https://www.phusionpassenger.com/library/indepth/ruby/multiple_rubies.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM