2012-07-26 67 views
3

我在使用我的新OSX Mountain Lion Install編譯Phusion Passenger時遇到問題。你有什麼建議嗎?Phusion Passenger不能在Mountain Lion中編譯

Installing Phusion Passenger Standalone... 
[*******************************    ] Compiling Phusion Passenger... 
*** ERROR: the following command failed: 
mkdir -p 'ext/ruby/ruby-1.9.3-x86_64-macosx/' 
cd 'ext/ruby/ruby-1.9.3-x86_64-macosx/' && /Users/boris/.rvm/wrappers/[email protected]/ruby '/Users/boris/.passenger/standalone/3.0.13-x86_64-ruby1.9.3-macosx-10.8/support/ext/ruby/extconf.rb' 
checking for alloca.h... *** /Users/boris/.passenger/standalone/3.0.13-x86_64-ruby1.9.3-macosx-10.8/support/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 
    --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=/Users/boris/.passenger/standalone/3.0.13-x86_64-ruby1.9.3-macosx-10.8/support/ext/ruby 
    --curdir 
    --ruby=/Users/boris/.rvm/rubies/ruby-1.9.3-p194/bin/ruby 
/Users/boris/.rvm/rubies/ruby-1.9.3-p194/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 /Users/boris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp' 
    from /Users/boris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header' 
    from /Users/boris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for' 
    from /Users/boris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone' 
    from /Users/boris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
    from /Users/boris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone' 
    from /Users/boris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
    from /Users/boris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in `postpone' 
    from /Users/boris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for' 
    from /Users/boris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:930:in `have_header' 
    from /Users/boris/.passenger/standalone/3.0.13-x86_64-ruby1.9.3-macosx-10.8/support/ext/ruby/extconf.rb:36:in `<main>' 
rake aborted! 
Command failed with status (1): [cd 'ext/ruby/ruby-1.9.3-x86_64-macosx/' &&...] 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `sh' 
/Users/boris/.passenger/standalone/3.0.13-x86_64-ruby1.9.3-macosx-10.8/support/build/ruby_extension.rb:43:in `block in <top (required)>' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain' 
/Users/boris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain' 
/Users/boris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain' 
/Users/boris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain' 
/Users/boris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run' 
/Users/boris/.rvm/gems/[email protected]/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>' 
/Users/boris/.rvm/gems/[email protected]/bin/rake:23:in `load' 
/Users/boris/.rvm/gems/[email protected]/bin/rake:23:in `<main>' 
Tasks: TOP => nginx => native_support => ext/ruby/ruby-1.9.3-x86_64-macosx//passenger_native_support.bundle => ext/ruby/ruby-1.9.3-x86_64-macosx//Makefile 

回答

5
  1. 看起來你正在使用RVM。因此,繼續前進,並重新編譯紅寶石

RVM卸載1.9.3 RVM安裝1.9.3

  1. 重新安裝乘客寶石
  2. 確保包括在conf文件爲您虛擬主機,其中升級到山獅可能破壞

在我的情況下,我補充說下面一行到我httpd.conf文件的末尾:

Include /etc/apache2/passenger_pane_vhosts/*.conf 
+1

感謝工作就像一個魅力! – 2012-07-26 22:25:19

+1

你的ruby命令幫助我修復了我在山獅上的po​​stgres gem問題。感謝broham。 – pjammer 2012-08-13 18:15:09

1

的根本原因是GCC-4.2無法找到。在我的情況下,海灣合作委員會4.2.1安裝,但只是所謂的gcc所以我將gcc-4.2連接到gcc,這讓我安裝乘客。命令行是sudo ln /usr/bin/gcc /usr/bin/gcc-4.2

我已經通過rvm重新安裝了Ruby,並在嘗試此操作之前重新下載了乘客gem,但我不認爲這兩者都是必需的。

+0

感謝這爲我做了,我想我也卸載/重新安裝超過我需要的。 – spilliton 2012-11-12 16:21:56

+0

如果你有一個自制的g ++ - 4.2,你可以這樣做: < - 語言:郎慶典 - > CD /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin #或您的版本 ln -s g ++ - 4.2 g ++ sudo PATH =/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin:$ PATH passenger-install-apache2-module rm g ++ – twelve17 2014-04-18 16:00:40

+0

呃,抱歉上面的格式不對。我的速度很慢,通過了五分鐘的記錄。 :/ – twelve17 2014-04-18 16:07:03

1

如果您安裝了rvm的二進制版本,也可能會遇到此問題。您也可以嘗試:

rvm uninstall 1.9.3-p327 
rvm install 1.9.3-p327 --disable-binary 

一旦完成,您應該能夠編譯Phusion Passenger而不會出現問題。或者至少沒有遇到這個問題。