Ruby on rails 通过rvm在使用ruby 2.0.0的ubuntu上安装passenger nginx模块时出错

Ruby on rails 通过rvm在使用ruby 2.0.0的ubuntu上安装passenger nginx模块时出错,ruby-on-rails,deployment,passenger,Ruby On Rails,Deployment,Passenger,我正在使用Ubuntu12.04LTS,Ruby2.0和RVM 在安装过程中。发生此错误 checking for alloca.h... *** /home/pastelcorp/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10/ext/ruby/extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary librari

我正在使用Ubuntu12.04LTS,Ruby2.0和RVM

在安装过程中。发生此错误

checking for alloca.h... *** /home/pastelcorp/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10/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/pastelcorp/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10/ext/ruby
    --curdir
    --ruby=/home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
/home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:561:in `try_cpp'
from /home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:1040:in `block in have_header'
from /home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:891:in `block in checking_for'
from /home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:336:in `block (2 levels) in postpone'
from /home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:306:in `open'
from /home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:336:in `block in postpone'
from /home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:306:in `open'
from /home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:332:in `postpone'
from /home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:890:in `checking_for'
from /home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:1039:in `have_header'
from /home/pastelcorp/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10/ext/ruby/extconf.rb:37:in `<main>'
rake aborted!
Command failed with status (1): [cd 'buildout/ruby/ruby-2.0.0-x86_64-linux/...]
/home/pastelcorp/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10/build/ruby_extension.rb:55:in `block in <top (required)>'
/home/pastelcorp/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
/home/pastelcorp/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => nginx => buildout/ruby/ruby-2.0.0-x86_64-linux//passenger_native_support.so => buildout/ruby/ruby-2.0.0-x86_64-linux//Makefile
(See full trace by running task with --trace)

对此有什么想法吗?

您必须先安装开发工具。

很可能您丢失了一些库,正如错误所示。几周前我遇到了同样的事情。这是一个很好的教程,类似于帮助我的教程

如果运气好的话,我相信这一行将解决您当前的问题,但请务必查看整个文档

sudo apt-get -y install curl git-core python-software-properties build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libcurl4-openssl-dev 
另外:在使用rvm时,我也经常遇到问题,并且发现rbenv的打嗝次数较少,这在本教程中已经提到

对于数据库,如果您不使用postgres,那么您应该能够将数据库中的位交换为与mysql等效的库。

问题已解决

在RVM中,我使用二进制文件安装了ruby2.0.0,而不是编译源代码

所以我做了

rvm删除2.0.0
rvm安装2.0.0----禁用二进制文件


所以ruby 2.0.0是从源代码编译而来的,而且编译效果很好。

问题解决了!检查我自己的答案。我已经安装了您提到的所有软件包。
——只需2个破折号即可禁用二进制文件。与Ubuntu 14.10、RVM 1.26.11和Ruby 2.2.3的相同处理非常有效。
sudo apt-get -y install curl git-core python-software-properties build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libcurl4-openssl-dev