2013-07-25 39 views
1

上使用Ruby 2.0.0 Ubuntu的安裝乘客nginx的模塊,我使用Ubuntu 12.04 LTS,紅寶石2.0 RVM錯誤上通過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 install build-essential

,這裏是我的mkmf.log文件(我不明白在所有)

" -o conftest -I/home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/x86_64-linux -I/home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/backward -I/home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0 -I/home/pastelcorp/.rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10/ext/ruby  -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC -g conftest.c -L. -L/home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib -Wl,-R/home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic  '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib -L/home/pastelcorp/.rvm/rubies/ruby-2.0.0-p247/lib -lruby -lpthread" 
sh: 1: -o: not found 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: int main(int argc, char **argv) 
4: { 
5: return 0; 
6: } 
/* end */ 

這個任何想法?

回答

12

問題解決了。

在RVM中,我用二進制安裝ruby2.0.0,不編譯源碼。

,所以我做

rvm remove 2.0.0rvm install 2.0.0 ----disable-binary

因此Ruby 2.0.0已經從源代碼編譯和乘客的編譯工作正常。

+3

' - 僅有2個破折號的'--disable-binary'。 – droptheplot

+0

與Ubuntu 14.10,RVM 1.26.11和Ruby 2.2.3的處理完全一樣。 – guapolo

1

You have to install development tools first.

最有可能你錯過了一些圖書館就像錯誤指示。幾周前我遇到了同樣的事情。這是一個類似於幫助我的好教程。

http://alexpearce.me/2012/06/setting-up-a-vps/

如果運氣好一點點,我相信,這條線將解決當前的問題,但一定要查看整個文檔。

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庫。

+0

問題解決了!檢查我自己的答案。我已經安裝了您提到的所有軟件包。 – synthresin