1

I've been trying without success to install the Nginx version of Phusion Passenger (mod_rails) on my server by using the command gem install passenger followed by passenger-install-nginx-module. Everything goes smoothly, until I get the below error at the end:

# sh ./configure --prefix='/opt/nginx' --with-http_ssl_module 
--with-pcre='/tmp/root-passenger-15796/pcre-8.10' 
--add-module='/usr/lib/ruby/gems/1.8/gems/passenger-3.0.6/ext/nginx'
checking for OS
 + Linux 2.6.18-028stab070.14 x86_64
checking for C compiler ... found but is not working

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

I'm not really sure what the problem could be. Any suggestions would be greatly appreciated. Thanks in advance!

Edits from Incognito (rather than adding a million comments):

I'm following the guides here so that I can run redmine on nginx using postgresql. This is rigged by a shell script from passenger-install-nginx-module which runs

sh ./configure --prefix='/opt/nginx' --with-http_ssl_module --with-cc-opt='-Wno-error' --add-module='/usr/lib/ruby/gems/1.8/gems/passenger-3.0.9/ext/nginx'

Right after attempting to install nginx with passenger...

Here's the relevant lines of code that throw this error: http://pastebin.com/GwrJcEkf

Here's a copy of the config.log that was spit out: http://pastebin.com/qkepYZ6X

I end up with the exact same issue on Ubuntu11, and Debian 6.

Incognito
  • 302
  • 4
  • 17
Luke Crowe
  • 11
  • 2
  • It may be worth mentioning, I'm following this http://library.linode.com/web-applications/project-management/redmine/ubuntu-11.04-natty so that I can run redmine on nginx using postgresql. This is trigged by a shell script from `/passenger-install-nginx-module` which runs `sh ./configure --prefix='/opt/nginx' --with-http_ssl_module --with-cc-opt='-Wno-error' --add-module='/usr/lib/ruby/gems/1.8/gems/passenger-3.0.9/ext/nginx'` right after attempting to install nginx with passenger. – Incognito Sep 22 '11 at 02:28
  • Here's the relevant lines of code that throw this error: http://pastebin.com/GwrJcEkf – Incognito Sep 22 '11 at 13:50
  • Here's a copy of the config.log that was spit out: http://pastebin.com/qkepYZ6X – Incognito Sep 22 '11 at 14:23

3 Answers3

1

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

You don't have gcc installed and you're trying to compile something with gcc.

sudo apt-get install gcc

photoionized
  • 464
  • 2
  • 6
  • I tried that. Gcc _is_ already installed, it's just not working. – Luke Crowe Apr 13 '11 at 22:47
  • Can I see an output of `gcc -v` and `uname -a` then? It sounds like automake can't find a working gcc compiler then... Have you ever compiled anything on this machine before? – photoionized Apr 13 '11 at 22:57
  • No, I haven't; I just got it. The output of `gcc -v` was a bunch of different "configured with" parameters, followed by `gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)`. The output of `uname -a` was `Linux syyborg.com 2.6.18-028stab070.14 #1 SMP Thu Nov 18 16:04:02 MSK 2010 x86_64 GNU/Linux`. – Luke Crowe Apr 13 '11 at 23:09
  • So, the following command that gets called in the configure script for nginx checks to see if you have a valid gcc compiler `gcc -v 2>&1 | grep 'gcc version' 2>&1 | sed -e 's/^.* version \(.*\)/\1/'` immediately after that the line where you see `checking for C compiler ... found but is not working` is printed, can you see what running the above command in your terminal does? – photoionized Apr 13 '11 at 23:34
  • better yet, compile a simple c program and see what you get--`echo 'int main(int argc, char** argv){return 1;}' > t.c; gcc -o t t.c; ./t` – photoionized Apr 13 '11 at 23:42
  • The command returns `4.4.3 (Ubuntu 4.4.3-4ubuntu5)`. – Luke Crowe Apr 13 '11 at 23:43
  • The second command ran with no errors. – Luke Crowe Apr 13 '11 at 23:44
  • Same results here -- No issues running GCC. – Incognito Sep 22 '11 at 02:30
1

apt-get install build-essential (sudo'ed if necessary) sorted out a similar issue for me in Debian.

David Oliver
  • 151
  • 1
  • 14
1

According to the Hongli Lai who is author of Phusion Passenger, check to see if you have /tmp is mounted with noexec option. If not, I suggest you manual compiling from source, it would works.

quanta
  • 51,413
  • 19
  • 159
  • 217