Closed scarver2 closed 9 years ago
Due to #10 it also has a (soft) dependency on libgnurx now. Although I don't see why that would cause your error. Could you show me the mkmf.log file? (Gist or e-mail preferred) Could you try to compile without this line? (Unfortunately, I don't have an OS X environment to test on)
Are you sure your system is prepared to install extension gems at all? The note "You have to install development tools first" seems to indicate otherwise.
To compile the gem: Change to /Users/me/.rvm/gems/ruby-2.2.0/extensions/x86_64-darwin-14/2.2.0/ruby-filemagic-0.6.2
and run /Users/me/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150206-87002-kyeyoq.rb extconf.rb
to generate the Makefile. If that succeeds you can run make
to compile.
One more thought to exclude the newly released version as the culprit: Can you install version 0.6.1? (gem install ruby-filemagic -v 0.6.1
)
Here is the mkmf.log for 0.6.2 https://gist.github.com/scarver2/984dc271202ec2207302
0.6.1 installs without issue.
The folder /Users/me/.rvm/gems/ruby-2.2.0/extensions/x86_64-darwin-14/2.2.0/ruby-filemagic-0.6.2
only contains gem_make.out
and mkmf.log
. No other files present.
I forked 0.6.2 repo and issued a gem build ruby-filemagic.gemspec
. It yielded this error:
WARNING: See http://guides.rubygems.org/specification-reference/ for help
ERROR: While executing gem ... (Gem::InvalidSpecificationException)
["lib/filemagic/magic.mgc"] are not files
Does this help?
clang: error: unsupported option '-static-libgcc'
Thanks, that line from mkmf.log says it all. Now we only need to find a way to avoid it.
The folder
/Users/me/.rvm/gems/ruby-2.2.0/extensions/x86_64-darwin-14/2.2.0/ruby-filemagic-0.6.2
only containsgem_make.out
andmkmf.log
. No other files present.
Oh, I'm sorry, it should be /Users/me/.rvm/gems/ruby-2.2.0/gems/ruby-filemagic-0.6.2/ext/filemagic
. And instead of removing this line I'd ask you to replace this line with:
$LDFLAGS << ' -static-libgcc' if RUBY_PLATFORM =~ /cygwin|mingw|mswin/
Does this help?
No, this only says that it can't find a particular file - which is dynamically generated during packaging.
That worked on OSX Yosemite. Testing on Windows now. Will report back ASAP.
Excellent! I've pushed the fix and will release a new version now. Thank you very much.
Testing on Windows now.
Let me stop you right there ;) Compiling on Windows is a tad more involved. That's what prompted this change in the first place (see #10).
Thank you for the fast response and resolution. A pleasure to work with you.
gem install ruby-filemagic
fails. Tried the usual trick ofenv ARCHFLAGS="-arch x86_64" gem install ruby-filemagic -- --with-magic-include=/usr/local/include --with-magic-lib=/usr/local/lib/
to no avail.Confirmed that
libmagic.1.dylib
andlibmagic.dylib
are in /usr/local/lib/. What other dependencies does this gem have?Building native extensions. This could take a while... ERROR: Error installing ruby-filemagic: ERROR: Failed to build gem native extension.
checking for main() in -lgnurx... * 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-2.2.0/bin/$(RUBY_BASE_NAME) --with-magic-dir --without-magic-dir --with-magic-include --without-magic-include=${magic-dir}/include --with-magic-lib --without-magic-lib=${magic-dir}/lib --with-gnurx-dir --without-gnurx-dir --with-gnurx-include --without-gnurx-include=${gnurx-dir}/include --with-gnurx-lib --without-gnurx-lib=${gnurx-dir}/lib --with-gnurxlib --without-gnurxlib /Users/me/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/mkmf.rb:456: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-2.2.0/lib/ruby/2.2.0/mkmf.rb:541:in
try_link0' from /Users/me/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/mkmf.rb:556:intry_link' from /Users/me/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/mkmf.rb:741:in
try_func' from /Users/me/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/mkmf.rb:972:inblock in have_library' from /Users/me/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/mkmf.rb:917:in
block in checking_for' from /Users/me/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/mkmf.rb:351:inblock (2 levels) in postpone' from /Users/me/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/mkmf.rb:321:in
open' from /Users/me/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/mkmf.rb:351:inblock in postpone' from /Users/me/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/mkmf.rb:321:in
open' from /Users/me/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/mkmf.rb:347:inpostpone' from /Users/me/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/mkmf.rb:916:in
checking_for' from /Users/me/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/mkmf.rb:967:inhave_library' from extconf.rb:9:in
extconf failed, exit code 1
Gem files will remain installed in /Users/me/.rvm/gems/ruby-2.2.0/gems/ruby-filemagic-0.6.2 for inspection. Results logged to /Users/me/.rvm/gems/ruby-2.2.0/extensions/x86_64-darwin-14/2.2.0/ruby-filemagic-0.6.2/gem_make.out