Failed to build gem native extension #7

Closed
jeremyjousse opened this Issue Jan 20, 2012 · 4 comments

3 participants

@jeremyjousse

Hello,

I'm trying to install tag lib-ruby on my Mac with Lion, ruby 1.9.2 installed with RVM and taglib installed with MacPorts.

After typing "gem install taglib-ruby" I have "Failed to build gem native extension".

This is the logs :

Building native extensions. This could take a while...
ERROR: Error installing taglib-ruby:
ERROR: Failed to build gem native extension.

    /Users/jerry/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb

checking for main() in -lstdc++... yes
checking for main() in -ltag... no
You must have taglib installed in order to use taglib-ruby.

Debian/Ubuntu: sudo apt-get install libtag1-dev
Fedora/RHEL: sudo yum install taglib-devel
Brew: brew install taglib
MacPorts: sudo port install taglib

*** 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=/Users/jerry/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
--with-tag-dir
--without-tag-dir
--with-tag-include
--without-tag-include=${tag-dir}/include
--with-tag-lib
--without-tag-lib=${tag-dir}/lib
--with-stdc++lib
--without-stdc++lib
--with-taglib
--without-taglib

Gem files will remain installed in /Users/jerry/.rvm/gems/ruby-1.9.2-p290/gems/taglib-ruby-0.3.0 for inspection.
Results logged to /Users/jerry/.rvm/gems/ruby-1.9.2-p290/gems/taglib-ruby-0.3.0/ext/taglib_base/gem_make.out

Can you help me to solve this problem?

Thanks a lot.

@robinst
Owner

Mkmf probably can't find taglib. Do you know where MacPorts installs the library (e.g. where is include/taglib/taglib.h)? /usr/local, /opt/local, /sw?

If you know that, you can re-run the command like this:

CONFIGURE_ARGS="--with-opt-dir=/usr/local" gem install taglib-ruby
@jeremyjousse

Hi Robinst,

Thank you it works perfactly with :
CONFIGURE_ARGS="--with-opt-dir=/opt/local/" gem install taglib-ruby

@rud1r055 rud1r055 added a commit to rud1r055/taglib-ruby that referenced this issue Jan 22, 2012
@robinst Default opt dirs in extconf to help mkmf find taglib (#7) c9706ee
@joshuachestang

Same issue when deploying on Heroku. Would I fix this by following the commands above?

@robinst
Owner

Please open a new issue! Either you don't have taglib installed or extconf can't find it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment