我正在使用Amazon Web服务(ubuntu 12.04.1 LTS)并使用Ruby 1.9.3和RVM(单用户安装)
我使用rvmsudo gem install passenger
我尝试rvmsudo passenger-install-apache2-module
它说出了问题.....
我认为有两个错误
第一个错误
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
所以我检查了mkmf.log,但我找不到问题所在。
在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.第二次错误
/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)
但我在这里找不到任何线索......
有人知道如何解决这个问题吗?
答案 0 :(得分:3)
我首先要确保通过安装build-essential来确保我已经为开发配置了Ubuntu,如下所示
xyz@supergLTS:~$ sudo apt-get install build-essential
这将获得make和gcc所需的所有开发工具,文件和标头。然后我会重新运行Apache2模块的构建过程
rvmsudo passenger-install-apache2-module
答案 1 :(得分:1)
我的问题通过重新安装乘客解决了,有些图书馆不见了,我想
#gem uninstall passenger
#gem install passenger
#passenger-install-apache2-module
答案 2 :(得分:0)
我通过将env PATH;
包含在nginx.conf
文件的最顶层来解决此问题。在我的情况下,我安装了所有必要的工具,但由于某种原因,nginx找不到它们,所以添加env PATH;
使它工作。另外,请不要忘记在更改配置后重新启动nginx服务。 sudo service nginx restart