使用RVM为不同的Ruby版本编译对乘客的本机支持 [英] Compile Passenger Native Support with RVM for different Ruby versions

查看:128
本文介绍了使用RVM为不同的Ruby版本编译对乘客的本机支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在CentOS 7上进行干净安装.

Clean installation on CentOS 7.

在〜/.rvm中以新用户乘客"的身份安装了RVM

Installed RVM in ~/.rvm as new user Passenger

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

All sites hosted are owned by Apache user

已安装2个红宝石的RVM:

Installed RVM with 2 rubies:

  • 1.9.3-p551(默认)
  • 2.3.0

我在默认的Ruby 1.9.3中将乘客"安装并编译为gem.

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

但是,我一直在使用Ruby 2.3.0的网站上的/var/log/httpd/error_log中获得这些条目:

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.

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

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).

如何建立对所有RVM安装版本的本机支持,并使该错误消失?

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

推荐答案

使用您要编译的Ruby来简单地运行"passenger-config build-native-support".

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

例如:

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

Passenger不在乎您用来安装Passenger的Ruby.您可以将Passenger与任何Ruby一起使用,无论您用于安装Passenger的是哪种Ruby. https://www.phusionpassenger.com/library/indepth/ruby/multiple_rubies.html

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

这篇关于使用RVM为不同的Ruby版本编译对乘客的本机支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆