ueno / ruby-gpgme

a ruby interface to GnuPG Made Easy (GPGME).
GNU Lesser General Public License v2.1
232 stars 99 forks source link

Unable to install on Mac Sierra #89

Open minhngocd opened 7 years ago

minhngocd commented 7 years ago

Hi - I am on OSX Sierra and when I attempt to gem install gpgme, I get the following errors:

Building native extensions.  This could take a while...
ERROR:  Error installing gpgme:
    ERROR: Failed to build gem native extension.
.......
checking for linker flags for static linking... NONE
checking for gpgme.h... yes
checking for gpgme >= 1.1.3... no
checking for gpgme_op_export_keys()... no
creating Makefile
........
compiling gpgme_n.c
couldn't understand kern.osversion `16.5.0'
linking shared-object gpgme_n.bundle
couldn't understand kern.osversion `16.5.0'
........
ld: warning: object file (...) was built for newer OSX version (10.12) than being linked (10.4)
ld: warning: object file (...) was built for newer OSX version (10.12) than being linked (10.4)
ld: targeted OS version does not support use of thread local variables in __gpgme_debug_frame_begin for architecture x86_64
collect2: ld returned 1 exit status
make: *** [gpgme_n.bundle] Error 1

make failed, exit code 2
jplethier commented 7 years ago

Any news about this? I am having the same issue trying to install this

ueno commented 7 years ago

I have no idea, but this looks obviously wrong, unless you build it with --use-system-libraries:

checking for gpgme_op_export_keys()... no

Could you collect the complete logs with --disable-clean?

$ gem install gpgme -- --disable-clean
$ find <gem directory> -name config.log
AndrewRayCode commented 6 years ago

I'm getting a different but similar error (also on high sierra)

************************************************************************
/Users/me/.rubies/ruby-2.1.5/lib/ruby/2.1.0/rubygems/ext/builder.rb:89:in `run': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)

    /Users/me/.rubies/ruby-2.1.5/bin/ruby extconf.rb
************************************************************************
IMPORTANT!  gpgme gem uses locally built versions of required C libraries,
namely libgpg-error, libassuan, and gpgme.

If this is a concern for you and you want to use the system library
instead, abort this installation process and reinstall gpgme gem as
follows:

    gem install gpgme -- --use-system-libraries

And when I try that:

gem install gpgme -- --use-system-libraries
Fetching: gpgme-2.0.16.gem (100%)
Building native extensions with: '--use-system-libraries'
This could take a while...
ERROR:  Error installing gpgme:
    ERROR: Failed to build gem native extension.

    /Users/me/.rubies/ruby-2.1.5/bin/ruby extconf.rb --use-system-libraries
checking for gpgme-config... no
gpgme-config not found
*** 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/.rubies/ruby-2.1.5/bin/ruby
    --clean
    --use-system-libraries

extconf failed, exit code 1

Gem files will remain installed in /Users/me/.gem/ruby/2.1.5/gems/gpgme-2.0.16 for inspection.
Results logged to /Users/me/.gem/ruby/2.1.5/extensions/x86_64-darwin-17/2.1.0-static/gpgme-2.0.16/gem_make.out

Edit: looks like this is the error:

conftest.c:13:15: warning: implicit declaration of function 'gpgme_op_export_keys' is invalid in C99 [-Wimplicit-function-declaration]
int t(void) { gpgme_op_export_keys(); return 0; }
LucasArruda commented 5 years ago

brew install gpgme fixes it