Search code examples
ubuntupassenger

passenger-install-apache2-module: It looks like something went wrong


I'm using Amazon web service(ubuntu 12.04.1 LTS) and using Ruby 1.9.3 with RVM (single-user installed)

I installed passenger with rvmsudo gem install passenger

and I tried to rvmsudo passenger-install-apache2-module

and it says something went wrong.....

I think there are two errors

  1. first error

    checking for alloca.h... *** /home/ubuntu/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/ext/ruby/extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of
    necessary libraries and/or headers.  Check the mkmf.log file for more
    details.  You may need configuration options.
    
    provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=/home/ubuntu/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/ext/ruby
        --curdir
        --ruby=/home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/bin/ruby
    

so I checked mkmf.log but I cannot find what is the problem.

in mkmf.log

" -o conftest -I/home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/include/ruby-1.9.1/x86_64-linux -I/home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/include/ruby-1.9.1/ruby/backward -I/home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/include/ruby-1.9.1 -I/home/ubuntu/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/ext/ruby     -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC -g conftest.c  -L. -L/home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib -Wl,-R/home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib -L.  -rdynamic -Wl,-export-dynamic     '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib -L/home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib -lruby  "
 sh: 0: Illegal option -
 Current option settings
 errexit         on
 noglob          on
 ignoreeof       on
 interactive     on
 monitor         on
 noexec          on
 stdin           on
 xtrace          on
 verbose         on
 vi              on
 emacs           on
 noclobber       on
 allexport       on
 notify          on
 nounset         on
 nolog           on
 debug           on
 checked program was:
 /* begin */
 1: #include "ruby.h"
 2:
 3: int main() {return 0;}
 /* end */

2.second error

 /home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
 You have to install development tools first.
from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/ext/ruby/extconf.rb:36:in `<main>'
 rake aborted!
 Command failed with status (1): [cd 'ext/ruby/ruby-1.9.3-x86_64-linux/' && ...]
 /home/ubuntu/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/build/ruby_extension.rb:43:in `block in <top (required)>'
 /home/ubuntu/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
 /home/ubuntu/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
 Tasks: TOP => apache2 => native_support => ext/ruby/ruby-1.9.3-x86_64-linux//passenger_native_support.so => ext/ruby/ruby-1.9.3-x86_64-linux//Makefile
 (See full trace by running task with --trace)

but I cant find any clue in here...

Does anybody know how to solve this?


Solution

  • Off the top of my head I would first make sure I had configured Ubuntu for development by installing build-essential as follows

    xyz@supergLTS:~$ sudo apt-get install build-essential
    

    This will get all the dev tools, files and headers that make and gcc will need. then I would rerun my build process for Apache2 modules

    rvmsudo passenger-install-apache2-module