我试图安装nginx通过RVM在Ruby 2.0.0-p0上运行带有Passenger(4.0.0.rc5)的Rails站点(3.2.13)。 我已经成功安装了Passenger Gem,但是在运行时:
rvmsudo passenger-install-nginx-module
在“编译乘客支持文件…”步骤中出现以下错误:
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
我正在使用默认选项,所以select:
1. Yes: download, compile and install Nginx for me. (recommended)
然后:
Please specify a prefix directory [/opt/nginx]:
所以默认的位置。 如果您需要更多信息,请告诉我。 这是一个错误,我的设置或我的VPS故障? 我只想要完成这一步开始使用服务器。 谢谢。
我也把这个问题发布到Phusion乘客Google组:
build议安装失败的原因是:
您的服务器可能没有足够的内存来运行编译器。 尝试增加交换空间。
然后我按照本指南在我的服务器上添加交换文件: https : //www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04重新运行nginx安装命令成功。