编译passenger-install-nginx-module;“未找到C编译器gcc”

编译passenger-install-nginx-module;“未找到C编译器gcc”

我正处于安装 Redmine 的过程中,该过程由 Passenger 和 nginx 完成本教程。使用passenger-install-nginx-module,它可以正常工作,但在编译过程中它会输出一个错误,

Compiling and installing Nginx...
# sh ./configure --prefix='/etc/nginx' --with-http_ssl_module --with-http_gzip_static_module --with-cc-opt='-Wno-error' --with-pcre='/tmp/root-passenger-3197/pcre-8.31' --add-module='/var/lib/gems/1.8/gems/passenger-3.0.18/ext/nginx'
checking for OS
 + Linux 3.2.0-32-generic-pae i686
checking for C compiler ... not found

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

--------------------------------------------

It looks like something went wrong

我不明白为什么它找不到 gcc,但在预检步骤中它说找到了 gcc,

Checking for required software...

 * GNU C++ compiler... found at /usr/bin/g++
 * The 'make' tool... found at /usr/bin/make
 * A download tool like 'wget' or 'curl'... found at /usr/bin/wget
 * Ruby development headers... found
 * OpenSSL support for Ruby... found
 * RubyGems... found
 * Rake... found at /usr/bin/rake
 * rack... found
 * Curl development headers with SSL support... found
 * OpenSSL development headers... found
 * Zlib development headers... found

然后我使用了apt-get可能的 gcc 包,但是由于我已经有它们了,所以没有安装/更新任何包。

编辑:

我尝试过使用 gcc 的软件包,

gcc-4.4 g++-4.4 libstdc++6-4.4-dev gcc

编辑:

redmine 的 nginx 块,

server {

    server_name         redmine.domain.com;

    access_log          /var/www/redmine.access.log;
    error_log           /var/www/redmine.error.log;

    root                /var/www/domain.com/redmine/public;

    passenger_enabled   on;
}

编辑:

passenger_root现在看来问题与和有关passenger_ruby,尽管我现在已经将其包含在 nginx.conf 中,但我不确定它们是否是正确的路径(我该怎么做才能找到正确的路径?)

我的 nginx.conf

user www-data;
worker_processes 4;
pid /var/run/nginx.pid;

events {
    worker_connections 768;
    # multi_accept on;
}

http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_disable "msie6";

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # nginx-naxsi config
    ##
    # Uncomment it if you installed nginx-naxsi
    ##

    #include /etc/nginx/naxsi_core.rules;

    ##
    # nginx-passenger config
    ##
    # Uncomment it if you installed nginx-passenger
    ##

    #passenger_root /usr;
    #passenger_ruby /usr/bin/ruby;

    passenger_root /var/lib/gems/1.8/gems/passenger-3.0.18;
    passenger_ruby /usr/bin/ruby1.8;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}


#mail {
#   # See sample authentication script at:
#   # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
# 
#   # auth_http localhost/auth.php;
#   # pop3_capabilities "TOP" "USER";
#   # imap_capabilities "IMAP4rev1" "UIDPLUS";
# 
#   server {
#       listen     localhost:110;
#       protocol   pop3;
#       proxy      on;
#   }
# 
#   server {
#       listen     localhost:143;
#       protocol   imap;
#       proxy      on;
#   }
#}

我该如何修复这个问题?

答案1

我的解决方案是将 /tmp 挂载为 noexec。我需要重新挂载它,以便 airline-install-nginx-module 可以在那里进行编译:

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

相关内容