Compile Passenger Native Support with RVM for different Ruby versions

岁酱吖の 提交于 2020-08-11 08:47:58

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/35869809/compile-passenger-native-support-with-rvm-for-different-ruby-versions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!