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

时间:2016-03-08 14:19:07

标签: ruby-on-rails ruby apache rubygems passenger

在CentOS 7上进行全新安装。

在〜/ .rvm中安装RVM作为新用户Passenger

托管的所有站点均归Apache用户所有

安装了2个红宝石的RVM:

  • 1.9.3-p551(默认)
  • 2.3.0

我在默认的Ruby 1.9.3中安装并编译了Passenger作为gem。

但是,我一直在使用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.

现在,通常只需运行passenger-config build-native-support,但这显然只适用于内置Passenger gem的Ruby环境(= 1.9.3)。

如何为所有RVM安装版本构建此本机支持并使此错误消失?

1 个答案:

答案 0 :(得分:2)

简单运行' passenger-config build-native-support'使用你想编译的Ruby。

例如:

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

乘客并不关心您用来安装Passenger的Ruby。您可以将Passenger与任何Ruby一起使用,无论您使用哪个Ruby安装Passenger。 https://www.phusionpassenger.com/library/indepth/ruby/multiple_rubies.html