Faild to build RMagick

Hi all,

for first sorry for my english.

Recently I’ve updated my Mac to El Capitan and re-installed (with
Homebrew) ImageMagick 6.9.2-7

Unfortunately bundle install seems doesn’t work becaus RMagick fail to
build.

Here the stack trace:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/me/.rvm/rubies/ruby-1.9.3-p327/bin/ruby -r
./siteconf20151204-39308-uw4m6y.rb extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for /usr/local/opt/gcc46/bin/gcc-4.6... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... 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
  --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=/Users/me/.rvm/rubies/ruby-1.9.3-p327/bin/ruby
/Users/me/.rvm/rubies/ruby-1.9.3-p327/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/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:506:in
`try_cpp'
  from
/Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:931:in
`block in have_header'
  from
/Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:790:in
`block in checking_for'
  from
/Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:284:in
`block (2 levels) in postpone'
  from
/Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:254:in
`open'
  from
/Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:284:in
`block in postpone'
  from
/Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:254:in
`open'
  from
/Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:280:in
`postpone'
  from
/Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:789:in
`checking_for'
  from
/Users/me/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:930:in
`have_header'
  from extconf.rb:194:in `<main>'

extconf failed, exit code 1

I’ve tried several different solutions founded on Internet but nothing
seems to fix this error.

With the operations below I receive always the errore above:

C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.9.2-7/include/ImageMagick-6/
gem install rmagick -v ‘2.13.2’

  1. gem install rmagick --version=2.13.2 --platform=ruby –
    –with-opt-lib=“h:/ImageMagick-6.9.2-7/lib”
    –with-opt-include=“h:/ImageMagick-6.9.2-7/include”

  2. $ cd /usr/local/Cellar/imagemagick/6.9.2-7/lib
    $ ln -s libMagick+±Q16.6.dylib libMagick++.dylib
    $ ln -s libMagickCore-Q16.2.dylib libMagickCore.dylib
    $ ln -s libMagickWand-Q16.2.dylib libMagickWand.dylib

The error still the same:
“The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.”

I’ve also updated xcoce to 7.1.1

I’m using ruby-1.9.3-p327 with RVM

Thanks in advance.

brew uninstall pkg-config
brew install pkg-config
brew unlink pkg-config && brew link pkg-config

not solve too

Hi Yuri,

Maybe you’re missing to accept the terms in Xcode. Open the program and
see
if it shows a license for you to accept.

If this don’t work you might want to try to install the command line
tools
from the apple developers site: https://developer.apple.com. Look for
“Command Line Tools (OS X 10.11) for Xcode 7.1”.

Hope it works,
Marco

Marco Antonio A. wrote in post #1179662:

Hi Yuri,

Maybe you’re missing to accept the terms in Xcode. Open the program and
see
if it shows a license for you to accept.

If this don’t work you might want to try to install the command line
tools
from the apple developers site: https://developer.apple.com. Look for
“Command Line Tools (OS X 10.11) for Xcode 7.1”.

Hope it works,
Marco

Thanks Marco but I’ve already accepted the terms and the Command line
tools is already installed too.

I don’t understand what is “Development tool” about the phrase:
… “You have to install development tools first” …
It’a about XCode or about a particular missing Libray?

Thanks again.

On Friday, December 4, 2015 at 3:47:50 PM UTC, Ruby-Forum.com User
wrote:

I don’t understand what is “Development tool” about the phrase:
… “You have to install development tools first” …
It’a about XCode or about a particular missing Libray?

It’s a slightly generic message. The build process generates some mini
test programs and tries to compile them, in order to verify things about
your environment (eg is there a C compiler, does it support certain
features etc.)

The fact that it passed some of the checks probably means it’s not as
simple as there being so developer tools. Stdint.h is something that
should be installed with the compiler toolchain - to understand further
you need to find the compiler error messages. This should be logged
somewhere - normally a failed gem extension build will output where it
has put the error output

Fred

Hi all,

re-installing Ruby 1.9.3 through RVM seems solved the issue.

Thanks.