Rong wrote:
> Terminal output
> ronald-greens-imac:~ ron$ sudo gem installrmagick
> Password:
> Building native extensions. This could take a while...
> ERROR: Error installingrmagick:
> ERROR: Failed to build gem native extension.
> /usr/local/bin/ruby extconf.rb installrmagick
> checking for Ruby version >= 1.8.2... yes
> checking for gcc... yes
> checking for Magick-config... yes
> checking for ImageMagick version >= 6.3.0... yes
> checking for HDRI disabled version of ImageMagick... yes
> checking for stdint.h... *** 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=.
> --curdir
> --ruby=/usr/local/bin/ruby
> /usr/local/lib/ruby/1.9.1/mkmf.rb:362:in `try_do': The complier failed
> to generate an executable file. (RuntimeError)
> You have to install development tools first.
> from /usr/local/lib/ruby/1.9.1/mkmf.rb:431:in `try_cpp'
> from /usr/local/lib/ruby/1.9.1/mkmf.rb:809:in `block in have_header'
> from /usr/local/lib/ruby/1.9.1/mkmf.rb:668:in `block in checking_for'
> from /usr/local/lib/ruby/1.9.1/mkmf.rb:274:in `block (2 levels) in
> postpone'
> from /usr/local/lib/ruby/1.9.1/mkmf.rb:248:in `open'
> from /usr/local/lib/ruby/1.9.1/mkmf.rb:274:in `block in postpone'
> from /usr/local/lib/ruby/1.9.1/mkmf.rb:248:in `open'
> from /usr/local/lib/ruby/1.9.1/mkmf.rb:270:in `postpone'
> from /usr/local/lib/ruby/1.9.1/mkmf.rb:667:in `checking_for'
> from /usr/local/lib/ruby/1.9.1/mkmf.rb:808:in `have_header'
> from extconf.rb:161:in `<main>'
> Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/
>rmagick-2.9.1 for inspection.
> Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.9.1/
> ext/RMagick/gem_make.out
> GCC version 4.0.1
> MkMF.log
> <main>: checking for Ruby version >= 1.8.2... -------------------- yes
> --------------------
> find_executable: checking for gcc... -------------------- yes
> --------------------
> find_executable: checking for Magick-config... --------------------
> yes
> --------------------
> <main>: checking for ImageMagick version >= 6.3.0...
> -------------------- yes
> --------------------
> <main>: checking for HDRI disabled version of ImageMagick...
> -------------------- yes
> --------------------
> Yes, this all that's in this file. I checked the last modified time
> and date and it is correct.
> As stated above the ImageMagick install is the os x binary.
> On Feb 27, 5:45 pm, Rong <ron.gr...@gmail.com> wrote:
>> the Mkmf.log.
>> <main>: checking for Ruby version >= 1.8.2... -------------------- yes
>> --------------------
>> find_executable: checking for gcc... -------------------- yes
>> --------------------
>> find_executable: checking for Magick-config... --------------------
>> yes
>> --------------------
>> <main>: checking for ImageMagick version >= 6.3.0...
>> -------------------- yes
>> --------------------
>> <main>: checking for HDRI disabled version of ImageMagick...
>> -------------------- yes
>> --------------------
>> On Feb 27, 3:11 pm, Tim Hunter <TimHun...@nc.rr.com> wrote:
>>> Charles Johnson wrote:
>>>> On Feb 27, 2009, at 2:24 PM, Rong wrote:
>>>>> Yes. At the end of the os x install instructions are 3 test commands
>>>>> that all work perfectly.
>>>>> On Feb 27, 1:08 pm, Charles Johnson > >>>>> <charles.john...@accre.vanderbilt.edu> wrote:
>>>> My conclusion would be, then, that the gem does not like ruby 1.9 just
>>>> yet. I am no help there, sorry.
>>>RMagickworks just fine with 1.9.1. I'm waiting for the O.P. to show his
>>> mkmf.log.
>>> --
>>>RMagick:http://rmagick.rubyforge.org/
I think your XCode Tools installation is corrupt and you need to reinstall.
Here's why. The failure occurs the first time extconf.rb tries to
execute gcc. Here's the same part of mkmf.log when I run it on OS X 10.5.6:
checking for Ruby version >= 1.8.2... -------------------- yes
--------------------
find_executable: checking for gcc... -------------------- yes
--------------------
find_executable: checking for Magick-config... -------------------- yes
--------------------
checking for ImageMagick version >= 6.3.0... -------------------- yes
--------------------
checking for HDRI disabled version of ImageMagick...-------------------- yes
--------------------
have_header: checking for stdint.h... -------------------- yes
"gcc -E -I. -I/usr/local/lib/ruby/1.8/powerpc-darwin9.4.0
-I/Users/timothyhunter/RMagick/ext/RMagick-I/opt/local/include
-I/opt/local/include/ImageMagick -Wall -g
-I/opt/local/include/ImageMagick conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include <stdint.h>
/* end */
--------------------
The first few tests don't use gcc. The Ruby version test checks the
value of RUBY_VERSION. The test for gcc searches your $PATH for the gcc
executable. Similarly the test for Magick-config searches your $PATH for
the Magick-config script. The test for the ImageMagick version executes
Magick-config and checks the output. The test for the "HDRI disabled
version of ImageMagick" also executes Magick-config.
It's not until the test for stdint.h that extconf.rb (via mkmf.rb) needs
to actually execute gcc. To perform this test, mkmf.rb a minimal C
program and then tries to compile it with gcc. If gcc successfully
compiles the program then mkmf.rb concludes that stdint.h is present,
otherwise it concludes that stdint.h is missing. (A missing stdint.h is
not a terminal error, btw.)
Now, if stdint.h was missing, this what you'd see in mkmf.log.
have_header: checking for stdint.h... -------------------- no
"gcc -E -I. -I/usr/local/lib/ruby/1.8/powerpc-darwin9.4.0 -I.
-I/opt/local/include -I/opt/local/include/ImageMagick -Wall -g
-I/opt/local/include/ImageMagick conftest.c -o conftest.i"
conftest.c:1:21: error: stdint.h: No such file or directory
checked program was:
/* begin */
1: #include <stdint.h>
/* end */
However, your mkmf.log file simply stops without even logging the
"checking for stdint.h..." that you see on the terminal. Also, there's
no Ruby traceback on the terminal, just an abrupt statement that "***
extconf.rb failed ***".
My conclusion is that gcc abended, forcing extconf.rb to stop running
immediately. Therefore the fix I recommend is to reinstall the XCode
Tools, either from your OS X install DVD or by downloading a new copy
from the Apple Developer Connection web site
(http://developer.apple.com). You may want to uninstall the current copy
of XCode Tools first, just to be sure. Here's instructions for doing
that:http://www.meandmark.com/xcodetips.html\.
Good luck!
--RMagick:http://rmagick.rubyforge.org/