部署 passenger-install-nginx 编译 Nginx 出错

xautjzd · 2014年04月20日 · 最后由 xautjzd 回复于 2014年04月20日 · 3911 次阅读

执行passenger-instal-nginx进行 nginx 的编译,走到最后的编译阶段,结果出现如下错误:

In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward/hash_map:60,
                 from ext/common/Utils/HashMap.h:46,
                 from ext/common/Utils/StringMap.h:33,
                 from ext/common/Utils/CachedFileStat.hpp:42,
                 from ext/common/ApplicationPool2/AppTypes.h:81,
                 from ext/common/ApplicationPool2/Options.h:32,
                 from ext/common/ApplicationPool2/Common.h:32,
                 from ext/common/ApplicationPool2/Pool.h:43,
                 from ext/common/ApplicationPool2/Implementation.cpp:31:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
c++: Internal error: Killed (program cc1plus)
Please submit a full bug report.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
rake aborted!
Command failed with status (1): [c++ -Iext -Iext/common -Iext/libev  -D_REENTRANT -I/usr/local/include -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -fcommon -feliminate-unused-debug-symbols -feliminate-unused-debug-types -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -ggdb -DHAS_ALLOCA_H -DHAVE_ACCEPT4 -DHAS_SFENCE -DHAS_LFENCE -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -DHASH_NAMESPACE="__gnu_cxx" -DHASH_MAP_HEADER="<hash_map>" -DHASH_MAP_CLASS="hash_map" -DHASH_FUN_H="<hash_fun.h>" -o buildout/common/libpassenger_common/ApplicationPool2/Implementation.o -c ext/common/ApplicationPool2/Implementation.cpp]
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.41/build/cplusplus_support.rb:51:in `run_compiler'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.41/build/cplusplus_support.rb:61:in `compile_cxx'
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.41/lib/phusion_passenger/common_library.rb:133:in `block (2 levels) in define_category_tasks'
Tasks: TOP => nginx => nginx_without_native_support => buildout/agents/PassengerHelperAgent => buildout/common/libpassenger_common/ApplicationPool2/Implementation.o
(See full trace by running task with --trace)
--------------------------------------------

It looks like something went wrong

Please read our Users guide for troubleshooting tips:

   /usr/local/rvm/gems/ruby-2.0.0-p451/gems/passenger-4.0.41/doc/Users guide Nginx.html
   http://www.modrails.com/documentation/Users%20guide%20Nginx.html

看了上面的报错信息,但是还是无法找出原因,大家帮忙看看吧

我感觉错误提示在下一行。

另外我建议错误日志发文本,不要截图。

#2 楼 @Rei 好谢谢,我改正下

#2 楼 @Rei 看网上答案,说可能是由于内存不足引起的

Increasing RAM size from 256 MB to 1 GB solved the issue, initially i was running an cloud instance with 256 MB of RAM, This makes g++ don't have enough memory to compile.

第一次编译过程中确实提示过这个问题,但是它建议说加 swap,所以我又加了 swap。再次编译后没提示了,但是走到这里编译出错。所以想会不会还是内存不足导致这个编译出错?

#4 楼 @xautjzd 这个不好验证啊,除非扩内存 😄

最好的做法是,在本地配个环境一致虚拟机,演练一遍

#4 楼 @xautjzd 有可能。建议用 passenger 预编译好的包,就是为了避免这个问题的。

#6 楼 @Rei

The RPMs are currently unmaintained. As such, the repository only contains Phusion Passenger 3.x (the latest version is 4.x), which did not support Node.js, Meteor, multiple Rubies, etc. For more recent versions of Phusion Passenger, you are suggested to install from gem or tarball instead.

官网说 rpm 包没维护了,所以感觉用着有点忐忑。这个应该没事吧

#5 楼 @lonre 感觉虚拟机运行的有点慢,本地机子性能不是很好,所以有点担忧。

9 楼 已删除

#7 楼 @xautjzd 哈,没留意。用 Ubuntu 吧。

@lonre 通常做法是采用 virgrant 在本地搭建一直的开发环境?

#10 楼 @Rei 有换 Ubuntu 的冲动了,现在上面还搭建了邮件服务器,花了两天配置的,推倒重来又得重新配环境,感觉可惜。不过总算是长知识了,知道 CentOS 不足点了。有没有性价比比较高的 VPS 推荐?虽然阿里云不错,但是还是无法搭建 ShadowSocks 代理,所以接下来准备买个便宜点的国外的 VPS。

#12 楼 @xautjzd Linode 或者 digitalocean

CentOS 给我的感觉就是各种编译(和问题),用 Ubuntu 基本都有编译好的包。

#11 楼 @xautjzd 部分人是这么做开发的,那些开发环境很难搭建的项目尤其推荐使用 virgrant 方式。

不过我本人没有使用 virgrant,因为当时有个文件系统挂载问题,导致测试不能自动运行的问题。类似这个:https://github.com/guard/listen/issues/57

#13 楼 @Rei @xautjzd 确实是这样的情况,编译麻烦,得细致的去看相关的文档

#14 楼 @lonre 现在有 RSync 方式挂载可以解决,但是测试了一下响应事件有 2 秒延迟,所以我还是在本机开发了。

#13 楼 @Rei Linode 确实看上去很诱人,但是价格略贵,DigitalOcean 看上去不错,10$/mon 的价格这配置比阿里云强多了,阿里云 55 元/mon,512m 内存

#16 楼 @Rei 后来我也没有细研究,直接本机开发。

#11 楼 @xautjzd 你说的是 vagrant 吧?

#19 楼 @hbin 囧,Copy & Paste 的结果

#19 楼 @hbin 不是,在阿里云的 vps 上进行的

需要 登录 后方可回复, 如果你还没有账号请 注册新账号