Forum: Ruby on Rails RMagick

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E3408e570b07f655c799bf5cd0b1f223?d=identicon&s=25 pete.d (Guest)
on 2005-12-29 07:52
Does anyone know how to solve 'No such file to load -- RMagick' on
'Instant Rails'?
770048af205ed307b8cf35ae2282ee2f?d=identicon&s=25 Michael Malone (Guest)
on 2009-02-27 14:20
(Received via mailing list)
Rong wrote:
> *** 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.
>
> What do I need to do?
>
>

Install the headers for ImageMagick.  If you're using a distro with a
package manager, it will probably end in -dev.

Ok, I just looked in the Ubuntu 8.10 manager and you want something
along the lines of libgraphicsmagick1-dev

But that's just a guess, I don't know exactly.  However, if you're using
Ubuntu you can just use synaptic to install rmagick and save yourself a
bunch of hassle :)

=======================================================================
This email, including any attachments, is only for the intended
addressee.  It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
 altered or corrupted during transmission.
=======================================================================
0cbff4df9c92e95f57a0b3baacb86c37?d=identicon&s=25 Ron Green (rgreen)
on 2009-02-27 15:59
(Received via mailing list)
I have fixed the problem above. I am running os x 10.5.6.
I am now getting a different error.

Last login: Thu Feb 26 15:26:59 on ttys000
ronald-greens-imac:~ ron$ convert logo: logo.gif
ronald-greens-imac:~ ron$ display logo.gif
X connection to /tmp/launch-30Nznb/:0 broken (explicit kill or server
shutdown).
ronald-greens-imac:~ ron$ sudo gem install rmagick
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
  ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb install rmagick
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.
770048af205ed307b8cf35ae2282ee2f?d=identicon&s=25 Michael Malone (Guest)
on 2009-02-27 16:19
(Received via mailing list)
Rong wrote:
> Building native extensions.  This could take a while...
> 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.
>
>
>
stdint.h is part of the C library.  This should be installed along with
a C compiler.  Please tell me you're not trying to compile a C extension
without a C compiler?

=======================================================================
This email, including any attachments, is only for the intended
addressee.  It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
 altered or corrupted during transmission.
=======================================================================
0cbff4df9c92e95f57a0b3baacb86c37?d=identicon&s=25 Ron Green (rgreen)
on 2009-02-27 16:58
(Received via mailing list)
GCC is installed.
Cd0dbf751457cf6fed1f69070d37006a?d=identicon&s=25 Charles Johnson (Guest)
on 2009-02-27 17:11
(Received via mailing list)
On Feb 26, 2009, at 4:54 PM, Rong wrote:

> GCC is installed.
>
Have you tried either the osx installer from rubyforge (automated
build from source: http://is.gd/l6pP ), or have you built the whole
shebang from scratch yourself using http://is.gd/glSd

I followed the second procedure myself with few problems.

Cheers--

Charles
---
Charles Johnson
Advanced Computing Center for Research and Education
Vanderbilt University
770048af205ed307b8cf35ae2282ee2f?d=identicon&s=25 Michael Malone (Guest)
on 2009-02-27 17:21
(Received via mailing list)
Rong wrote:
> GCC is installed.
>
>
Oh sorry, I was a little blind there.  So have you checked to see
whether /usr/include/stdint.h exists?

=======================================================================
This email, including any attachments, is only for the intended
addressee.  It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
 altered or corrupted during transmission.
=======================================================================
3afd3e5e05dc9310c89aa5762cc8dd1d?d=identicon&s=25 Tim Hunter (Guest)
on 2009-02-27 17:29
(Received via mailing list)
Rong wrote:
> I have fixed the problem above. I am running os x 10.5.6.
> I am now getting a different error.
(snip)
> 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.

What does the mkmf.log file have to say?
0cbff4df9c92e95f57a0b3baacb86c37?d=identicon&s=25 Ron Green (rgreen)
on 2009-02-27 19:58
(Received via mailing list)
Charles, trying to install the gem.

On Feb 27, 9:08 am, Charles Johnson
Cd0dbf751457cf6fed1f69070d37006a?d=identicon&s=25 Charles Johnson (Guest)
on 2009-02-27 20:12
(Received via mailing list)
And imagemagick installed without issues?

Cheers--

Charles
On Feb 27, 2009, at 12:57 PM, Rong wrote:

>> shebang from scratch yourself usinghttp://is.gd/glSd
>
---
Charles Johnson
Advanced Computing Center for Research and Education
Vanderbilt University
charles.johnson@accre.vanderbilt.edu
Office: 615-343-2776
Cell: 615-478-8799
0cbff4df9c92e95f57a0b3baacb86c37?d=identicon&s=25 Ron Green (rgreen)
on 2009-02-27 21:27
(Received via mailing list)
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
Cd0dbf751457cf6fed1f69070d37006a?d=identicon&s=25 Charles Johnson (Guest)
on 2009-02-27 21:58
(Received via mailing list)
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.

Cheers--

Charles
---
Charles Johnson
Advanced Computing Center for Research and Education
Vanderbilt University
0cbff4df9c92e95f57a0b3baacb86c37?d=identicon&s=25 Ron Green (rgreen)
on 2009-02-27 22:06
(Received via mailing list)
Don't know where it is.
3afd3e5e05dc9310c89aa5762cc8dd1d?d=identicon&s=25 Tim Hunter (Guest)
on 2009-02-27 22:13
(Received via mailing list)
Charles Johnson wrote:
> yet. I am no help there, sorry.
>
>

RMagick works just fine with 1.9.1. I'm waiting for the O.P. to show his
mkmf.log.
0cbff4df9c92e95f57a0b3baacb86c37?d=identicon&s=25 Ron Green (rgreen)
on 2009-02-27 22:21
(Received via mailing list)
I am running Ruby 1.9.1. Does that matter?
0cbff4df9c92e95f57a0b3baacb86c37?d=identicon&s=25 Ron Green (rgreen)
on 2009-02-27 22:34
(Received via mailing list)
I found it.
Here is the line(s) referenced.

def try_do(src, command, &b)
  unless have_devel?
    raise <<MSG
The complier failed to generate an executable file.
You have to install development tools first.
MSG
  end
  src = create_tmpsrc(src, &b)
  xsystem(command)
ensure
  log_src(src)
  rm_rf 'conftest.dSYM'
end
B33ea5c12d767bfd1253940a960274f5?d=identicon&s=25 Tim Hunter (timhunter)
on 2009-02-27 23:25
(Received via mailing list)
On Feb 26, 11:02 pm, Rong <ron.gr...@gmail.com> wrote:
> Don't know where it is.
>

/usr/local/lib/ruby/gems/1.8/gems/rmagick-2.9.1/ext/RMagick/mkmf.log
0cbff4df9c92e95f57a0b3baacb86c37?d=identicon&s=25 Ron Green (rgreen)
on 2009-02-27 23:51
(Received via mailing list)
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

--------------------
0cbff4df9c92e95f57a0b3baacb86c37?d=identicon&s=25 Ron Green (rgreen)
on 2009-02-27 23:52
(Received via mailing list)
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

--------------------
3afd3e5e05dc9310c89aa5762cc8dd1d?d=identicon&s=25 Tim Hunter (Guest)
on 2009-02-28 00:32
(Received via mailing list)
Rong wrote:
> find_executable: checking for Magick-config... --------------------
> -------------------- yes
>>> My conclusion would be, then, that the gem does not like ruby 1.9 just
>>> yet. I am no help there, sorry.
>> RMagick works just fine with 1.9.1. I'm waiting for the O.P. to show his
>> mkmf.log.
>>
>> --
>> RMagick:http://rmagick.rubyforge.org/
>
>

This can't be all of it. It doesn't include the failure you described in
your post:

checking for stdint.h... *** extconf.rb failed ***

Why don't you start over and post the output from "gem install" and then
mkmf.log? Also, where did you get the XCode Tools (install disk?
download?), how did you install ImageMagick, and what's the output from

gcc --version
0cbff4df9c92e95f57a0b3baacb86c37?d=identicon&s=25 Ron Green (rgreen)
on 2009-02-28 00:46
(Received via mailing list)
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

--------------------
0cbff4df9c92e95f57a0b3baacb86c37?d=identicon&s=25 Ron Green (rgreen)
on 2009-02-28 05:29
(Received via mailing list)
Terminal output

ronald-greens-imac:~ ron$ sudo gem install rmagick
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
  ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb install rmagick
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.
3afd3e5e05dc9310c89aa5762cc8dd1d?d=identicon&s=25 Tim Hunter (Guest)
on 2009-02-28 16:50
(Received via mailing list)
Rong wrote:
> checking for gcc... yes
>   --without-opt-dir
> to generate an executable file. (RuntimeError)
>   from /usr/local/lib/ruby/1.9.1/mkmf.rb:667:in `checking_for'
> GCC version 4.0.1
>
> <main>: checking for HDRI disabled version of ImageMagick...
>>
>>
>> --------------------
>>>>> <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.
>>> RMagick works 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!
0cbff4df9c92e95f57a0b3baacb86c37?d=identicon&s=25 Ron Green (rgreen)
on 2009-03-01 05:10
(Received via mailing list)
I downloaded the newest version of XCode Tools from ADC.
I cannot uninstall previous version because the file referenced in the
link you provided does not exist.
Anyway, reinstalled Xcode tools 3.1.2.

Reran sudo gem instakk RMagick.

Same result.
3afd3e5e05dc9310c89aa5762cc8dd1d?d=identicon&s=25 Tim Hunter (Guest)
on 2009-03-01 15:22
(Received via mailing list)
Rong wrote:
> I downloaded the newest version of XCode Tools from ADC.
> I cannot uninstall previous version because the file referenced in the
> link you provided does not exist.
> Anyway, reinstalled Xcode tools 3.1.2.
>
> Reran sudo gem instakk RMagick.
>
> Same result.
>

Well, that was my best shot. Sorry, I don't have any other suggestions.
Perhaps somebody else will be able to help. Good luck!
This topic is locked and can not be replied to.