在 Ubuntu 12.10 上为 Ruby 2.0.0 安装带有 Passenger 的 nginx 时出错

在 Ubuntu 12.10 上为 Ruby 2.0.0 安装带有 Passenger 的 nginx 时出错

我正在尝试安装 nginx,以便通过 RVM 在 Ruby 2.0.0-p0 上运行带有 Passenger (4.0.0.rc5) 的 Rails 站点 (3.2.13)。我已成功安装了 Passenger gem,但在运行时:

rvmsudo passenger-install-nginx-module

我在‘编译 Passenger 支持文件...’步骤中收到以下错误:

g++ -o agents/PassengerHelperAgent.o  -Iext -Iext/common  -Iext/libev -Iext/libeio -D_REENTRANT -I/usr/local/include -DHAS_TR1_UNORDERED_MAP -DHAVE_ACCEPT4 -DHAS_ALLOCA_H -DHAS_SFENCE -DHAS_LFENCE -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -ggdb -feliminate-unused-debug-symbols -feliminate-unused-debug-types -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -fcommon -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -c ext/common/agents/HelperAgent/Main.cpp
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions.
rake aborted!
Command failed with status (4): [g++ -o agents/PassengerHelperAgent.o  -Iex...]
/home/rich/.rvm/gems/ruby-2.0.0-p0@global/gems/passenger-4.0.0.rc5/build/cplusplus_support.rb:31:in `compile_cxx'
/home/rich/.rvm/gems/ruby-2.0.0-p0@global/gems/passenger-4.0.0.rc5/build/agents.rb:87:in `block in <top (required)>'
/home/rich/.rvm/gems/ruby-2.0.0-p0@global/bin/ruby_noexec_wrapper:14:in `eval'
/home/rich/.rvm/gems/ruby-2.0.0-p0@global/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => nginx => nginx_without_native_support => agents/PassengerHelperAgent

我使用默认选项,因此选择:

1. Yes: download, compile and install Nginx for me. (recommended)

然后:

Please specify a prefix directory [/opt/nginx]:

所以是默认位置。如果您需要更多信息,请告诉我。是错误、我的设置还是我的 VPS 出了问题?我只想完成此步骤以开始使用服务器。谢谢。

答案1

我还将这个问题发布到了 Phusion Passenger Google Group:https://groups.google.com/forum/?fromgroups=#!topic/phusion-passenger/V-t5xsHJ4Sw

安装失败的建议原因是:

您的服务器可能没有足够的内存来运行编译器。请尝试增加交换空间。

然后我按照本指南在我的服务器上添加交换文件:https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04 重新运行 nginx 安装命令已成功完成。

相关内容