本文介绍了安装乘客和 nginx 时找不到 C 编译器 gcc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 VPS 上安装Passenger 和 Nginx.

I'm trying to install Passenger and Nginx on my VPS.

我按照 这些说明 并替换了所有链接当前版本的所有来源.

I followed these instructions and replaced all links of all sources to the current version.

但是当我为 Nginx 运行 Phusion Passenger 安装程序时,gcc 编译器出现了问题:

But when i ran the Phusion Passenger installer for Nginx, something with gcc compiler went wrong:

Compiling and installing Nginx...
# sh ./configure --prefix='/opt/nginx' --with-http_ssl_module --with-http_gzip_static_module --with-cc-opt='-Wno-error' --add-module='/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.17/ext/nginx'
checking for OS
 + Linux 2.6.32-220.el6.x86_64 x86_64
checking for C compiler ... not found

./configure: error: C compiler gcc is not found

我该怎么办?

OBS:我的 VPS 适用于 CentOS 6.2 x64

推荐答案

如果您确实安装了 gcc,则问题源于/tmp 被挂载为 noexec.该错误并不完全有帮助,但如果您将/tmp 重新安装为 exec,您可以正确安装乘客.

If you do have gcc installed, the problem stems from /tmp being mounted as noexec. The error doesn't exactly help, but if you remount /tmp as exec you can install passenger properly.

mount -o remount,rw,exec,nosuid /tmp

这篇关于安装乘客和 nginx 时找不到 C 编译器 gcc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 17:49