【问题标题】:Phusion Passenger Doesn't compile in Mountain LionPhusion 乘客无法在 Mountain Lion 中编译
【发布时间】:2012-07-25 14:11:48
【问题描述】:

我在使用新的 OSX Mountain Lion 安装程序编译 Phusion Passenger 时遇到问题。你有什么建议吗?

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/ruby-1.9.3-p194@apps2/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/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/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/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/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/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/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/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/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/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/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/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@apps2/bin/rake:23:in `load'
/Users/boris/.rvm/gems/ruby-1.9.3-p194@apps2/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

【问题讨论】:

    标签: ruby-on-rails ruby xcode passenger osx-mountain-lion


    【解决方案1】:
    1. 看起来您正在使用 RVM。所以继续重新编译 ruby​​

    rvm 卸载 1.9.3 rvm 安装 1.9.3

    1. 重新安装乘客 Gem
    2. 确保包含虚拟主机的 .conf 文件,升级到 Mountain Lion 可能会破坏这些文件

    就我而言,我将以下行添加到我的 httpd.conf 文件的末尾:

    Include /etc/apache2/passenger_pane_vhosts/*.conf
    

    【讨论】:

    • 您的 ruby​​ 命令也帮助修复了我在 Mountain Lion 上的 postgres gem 问题。谢谢兄弟。
    【解决方案2】:

    根本原因是找不到gcc-4.2。在我的情况下,gcc 4.2.1 已安装但只是称为gcc,所以我将gcc-4.2 链接到gcc,这让我可以安装Passenger。命令行是sudo ln /usr/bin/gcc /usr/bin/gcc-4.2

    在尝试此操作之前,我已通过 rvm 重新安装了 Ruby 并重新下载了乘客 gem,但我认为这些都没有必要。

    【讨论】:

    • 谢谢你帮我做的,我想我卸载/重新安装的次数也超出了我的需要。
    • 如果你有自制的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:$PATHpassenger-install-apache2-module rm g++
    • 呃,抱歉上面的格式不好。我的连接速度很慢,我已经过了五分钟。 ://
    【解决方案3】:

    如果您安装 rvm 的二进制版本,您也可能会遇到此问题。你也可以试试:

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

    完成后,您应该可以毫无问题地编译 Phusion Passenger。或者至少没有遇到这个问题。

    【讨论】:

      猜你喜欢
      • 2013-02-10
      • 1970-01-01
      • 2012-10-21
      • 1970-01-01
      • 2012-08-17
      • 1970-01-01
      • 2012-01-23
      • 2017-02-15
      • 2012-03-14
      相关资源
      最近更新 更多