Обновление до Lion, не удалось собрать собственные расширения gem - PullRequest
5 голосов
/ 28 июля 2011

Не уверен, что моя проблема связана с этой темой (http://stackoverflow.com/questions/6589066/rmagick-and-os-x-lion),, но я только что обновился до Lion; более конкретно, я купил новую машину и перенес ее поверх моего старого профиля.

Я не могу запустить rails 3, потому что он не может найти rmagick, и я не могу установить rmagick, потому что я получаю следующую ошибку. Я попытался удалить rmagick и imageMagick, но я все еще получаю ту же ошибку при попытке комплектной установки. Какие-нибудь мысли? Спасибо

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 Поэтому я обновился до Xcode4, и когда я brew --config, он все еще указывает, что мне не хватает GCC:

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 

Как это может быть ??

Ответы [ 3 ]

6 голосов
/ 28 июля 2011

Похоже, вам нужно установить Xcode Unix Development Tools.

При установке Xcode из Mac App Store вы можете установить инструменты Unix: http://itunes.apple.com/us/app/xcode/id448457090?mt=12

4 голосов
/ 27 июля 2012

Я перепробовал все методы, упомянутые здесь, ничего не помогло. Это спасло мой день: https://gist.github.com/3182604

Примечание: 1. Обновите XCode из Настройки / Загрузки 2. Установите X11.app 3. И только потом исправим ImageMagick gem

0 голосов
/ 05 августа 2011

Из инструкции по установке Homebrew по адресу https://github.com/mxcl/homebrew/wiki/Installation

"1 Установка через App Store работает только для пользователей Lion. Для других версий Mac OS X см. Здесь. Если вы устанавливаете черезApp Store, вам нужно будет запустить приложение «Install Xcode», которое находится в /Applications."

...