简体   繁体   English

使用RVM为不同的Ruby版本编译Passenger Native Support

[英]Compile Passenger Native Support with RVM for different Ruby versions

Clean installation on CentOS 7. 在CentOS 7上进行全新安装。

Installed RVM in ~/.rvm as new user Passenger 将RVM作为新用户Passenger安装在〜/ .rvm中

All sites hosted are owned by Apache user 托管的所有站点均由Apache用户拥有

Installed RVM with 2 rubies: 已安装2个红宝石的RVM:

  • 1.9.3-p551 (default) 1.9.3-p551(默认)
  • 2.3.0 2.3.0

I installed and compiled Passenger as a gem in the default Ruby 1.9.3. 我在默认的Ruby 1.9.3中将Passenger安装和编译为gem。

However, I keep getting these entries in my /var/log/httpd/error_log on the sites that use Ruby 2.3.0: 但是,我在使用Ruby 2.3.0的网站上的/var/log/httpd/error_log不断获得这些条目:

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). 现在,通常您只需要运行passenger-config build-native-support但这显然仅适用于内置Passenger宝石(= 1.9.3)的Ruby环境。

How do I build this native support for ALL RVM installed versions and make this error go away? 如何建立对所有RVM安装版本的本机支持,并使该错误消失?

Simple run 'passenger-config build-native-support' using the Ruby you wish to compile for. 使用您要编译的Ruby来简单地运行“ passenger-config build-native-support”。

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. 乘客不关心您用来安装乘客的Ruby。 You can use Passenger with any Ruby, no matter which Ruby you used to install Passenger. 您可以将Passenger与任何Ruby一起使用,无论您用于安装Passenger的是哪种Ruby。 https://www.phusionpassenger.com/library/indepth/ruby/multiple_rubies.html https://www.phusionpassenger.com/library/indepth/ruby/multiple_rubies.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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