升级到Lion,无法构建gem原生扩展 [英] Upgrade to Lion, failed to build gem native extensions
问题描述
不知道我的问题是否与此线程相关(http://stackoverflow.com/questions/6589066/rmagick-and-os-x-lion),但我刚刚升级为Lion;更具体地说,我购买了一台新机器并通过我的旧配置文件迁移。
我无法启动rails 3,因为它找不到rmagick,而且我无法安装rmagick,因为出现以下错误。我尝试卸载rmagick和imageMagick,但尝试捆绑安装时仍然出现相同的错误。有什么想法吗?
谢谢
使用本地扩展/ opt / local / lib / ruby / site_ruby安装rmagick(2.13.1) /1.8/rubygems/installer.rb:551:in`build_extensions':错误:无法构建gem本机扩展。 (Gem :: Installer :: ExtensionBuildError)
/ opt / local / bin / ruby extconf.rb
检查Ruby版本> = 1.8.5 ...是
检查/usr/bin/gcc-4.2 ... no
在$ {ENV ['PATH']}中找不到C编译器。有关详细信息,请参阅mkmf.log。
*** extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少
必需的库和/或头文件。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。
提供的配置选项:
--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 =。
--curdir
--ruby = / opt / local / bin / ruby
Gem文件将保留安装在/ opt / local / lib / ruby /宝石/ 1.8 /宝石/ rmagick-2.13.1进行检验。
从/ opt / local / lib / ruby / site_ruby记录到/opt/local/lib/ruby/gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
的结果/1.8/rubygems/installer.rb:504:in`each'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:504:in`build_extensions'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:180:in`install'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15 /lib/bundler/source.rb:101:in从/opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:78安装
:在`preserve_paths'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/source.rb:91:in`install'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:58:in`run'
from / opt / local / lib / ruby / gems /1.8/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:93:in`with_build_args'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15 /lib/bundler/installer.rb:57:在`run'
f rom /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in`每个'
从/ opt / local / lib / ruby / gems / 1.8 / gems / bundler-1.0.15 / lib / bundler / spec_set.rb:12:在`each'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0。 15 / lib / bundler / installer.rb:49:在'运行'中
从/opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb: 8:在`install'中安装
/opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/cli.rb:222:in`install'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in`send'
from / opt / local / lib / ruby / gems / 1.8 / gems / bundler-1.0.15 / lib / bundler / vendor / thor / task.rb:22:在`run'
从/ opt / local / lib / ruby / gems / 1.8 / gems / bundler-1.0.15 / lib / bundler / vendor / thor / invocation.rb:118:在`invoke_task'
from /opt/local/lib/ruby/gems/1.8/gems/bundler- 1.0.15 / lib / bundler / vendor / thor.rb:246:在`dispatch'
/opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/供应商/thor/base.rb:389:in`start'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/bin/bundle:13
from / opt / local / bin / bundle:19:在`load'
从/ opt / local / bin / bundle:19
更新
所以我更新到Xcode4,当我 brew --config
时,它仍然表明我缺少GCC的东西: p>
HOMEBREW_VERSION:0.8
HEAD:8368fe489bde47b8f201bfcfdf328944fdf7092b
HOMEBREW_PREFIX:/ usr / local
HOMEBREW_CELLAR:/ usr / local / Cellar
HOMEBREW_REPOSITORY:/ usr / local
HOMEBREW_LIBRARY_PATH:/ usr / local / Library / Homebrew
硬件:四核64位sandybridge
OS X:10.7
内核架构:x86_64
Ruby:1.8.7-249
/ usr / bin / ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode:
GCC-4.0:N / A
GCC-4.2:N / A
这怎么可能?
看来您需要安装Xcode的Unix开发工具。
当您从Mac App Store安装Xcode时,您可以安装Unix工具: http://itunes.apple.com/us/app/xcode/ id448457090?mt = 12
Not sure if my problem is related to this thread (http://stackoverflow.com/questions/6589066/rmagick-and-os-x-lion), but I just upgraded to Lion; more specifically I purchased an new machine and migrated over my old profile.
I am unable to launch rails 3 because it cannot find rmagick, and I am unable to install rmagick, because I get the following error. I tried uninstalling rmagick and imageMagick, but I still get the same error when attempting to bundle install. Any thoughts? Thank you
Installing rmagick (2.13.1) with native extensions /opt/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:551:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/opt/local/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for /usr/bin/gcc-4.2... no
No C compiler found in ${ENV['PATH']}. See mkmf.log for details.
*** 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=.
--curdir
--ruby=/opt/local/bin/ruby
Gem files will remain installed in /opt/local/lib/ruby/gems/1.8/gems/rmagick-2.13.1 for inspection.
Results logged to /opt/local/lib/ruby/gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:504:in `each'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:504:in `build_extensions'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:180:in `install'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/source.rb:101:in `install'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/source.rb:91:in `install'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:58:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:57:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:49:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:8:in `install'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/cli.rb:222:in `install'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `send'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/base.rb:389:in `start'
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.15/bin/bundle:13
from /opt/local/bin/bundle:19:in `load'
from /opt/local/bin/bundle:19
UPDATE
So I updated to Xcode4 and when I brew --config
it still indicates that I am missing GCC stuff:
HOMEBREW_VERSION: 0.8
HEAD: 8368fe489bde47b8f201bfcfdf328944fdf7092b
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: quad-core 64-bit sandybridge
OS X: 10.7
Kernel Architecture: x86_64
Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode:
GCC-4.0: N/A
GCC-4.2: N/A
How can this be??
It appears that you need to install Xcode's Unix Development Tools.
You can install the Unix tools when you install Xcode from the Mac App Store: http://itunes.apple.com/us/app/xcode/id448457090?mt=12
这篇关于升级到Lion,无法构建gem原生扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!