ueno / ruby-gpgme

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

Cannot install on OS X 10.10(.1) #55

Closed zykadelic closed 9 years ago

zykadelic commented 9 years ago

Install is complaining about "You have to install development tools first.", but development tools is already installed and up to date.

$ brew doctor
Your system is ready to brew.
$ gem install gpgme
Building native extensions.  This could take a while...
ERROR:  Error installing gpgme:
    ERROR: Failed to build gem native extension.

    /Users/zykadelic/.rvm/rubies/ruby-1.9.3-p547/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

************************************************************************
sh: line 1: 47984 Segmentation fault: 11  /usr/local/opt/gcc46/bin/gcc-4.6 -v 2>&1
Extracting libgpg-error-1.13.tar.bz2 into tmp//ports/libgpg-error/1.13... OK
Running 'configure' for libgpg-error 1.13... OK
Running 'compile' for libgpg-error 1.13... OK
Running 'install' for libgpg-error 1.13... OK
Activating libgpg-error 1.13 (from /Users/zykadelic/.rvm/gems/ruby-1.9.3-p547/gems/gpgme-2.0.7/ports//libgpg-error/1.13)...
sh: line 1: 51364 Segmentation fault: 11  /usr/local/opt/gcc46/bin/gcc-4.6 -v 2>&1
Extracting libassuan-2.1.2.tar.bz2 into tmp//ports/libassuan/2.1.2... OK
Running 'configure' for libassuan 2.1.2... OK
Running 'compile' for libassuan 2.1.2... OK
Running 'install' for libassuan 2.1.2... OK
Activating libassuan 2.1.2 (from /Users/zykadelic/.rvm/gems/ruby-1.9.3-p547/gems/gpgme-2.0.7/ports//libassuan/2.1.2)...
sh: line 1: 54987 Segmentation fault: 11  /usr/local/opt/gcc46/bin/gcc-4.6 -v 2>&1
Extracting gpgme-1.5.1.tar.bz2 into tmp//ports/gpgme/1.5.1... OK
Running 'configure' for gpgme 1.5.1... OK
Running 'compile' for gpgme 1.5.1... OK
Running 'install' for gpgme 1.5.1... OK
Activating gpgme 1.5.1 (from /Users/zykadelic/.rvm/gems/ruby-1.9.3-p547/gems/gpgme-2.0.7/ports//gpgme/1.5.1)...
checking for linker flags for static linking... *** 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/zykadelic/.rvm/rubies/ruby-1.9.3-p547/bin/ruby
    --clean
    --use-system-libraries
/Users/zykadelic/.rvm/rubies/ruby-1.9.3-p547/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/zykadelic/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'
    from /Users/zykadelic/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:476:in `try_link'
    from extconf.rb:159:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/zykadelic/.rvm/gems/ruby-1.9.3-p547/gems/gpgme-2.0.7 for inspection.
Results logged to /Users/zykadelic/.rvm/gems/ruby-1.9.3-p547/extensions/x86_64-darwin-13/1.9.1/gpgme-2.0.7/gem_make.out
$ gem install gpgme -- --use-system-libraries
Building native extensions with: '--use-system-libraries'
This could take a while...
ERROR:  Error installing gpgme:
    ERROR: Failed to build gem native extension.

    /Users/zykadelic/.rvm/rubies/ruby-1.9.3-p547/bin/ruby extconf.rb --use-system-libraries
checking for gpgme-config... yes
checking for gpgme >= 1.1.3... *** 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/zykadelic/.rvm/rubies/ruby-1.9.3-p547/bin/ruby
    --clean
    --use-system-libraries
/Users/zykadelic/.rvm/rubies/ruby-1.9.3-p547/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/zykadelic/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'
    from /Users/zykadelic/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:712:in `try_run'
    from extconf.rb:185:in `block in <main>'
    from /Users/zykadelic/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
    from /Users/zykadelic/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
    from /Users/zykadelic/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /Users/zykadelic/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
    from /Users/zykadelic/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /Users/zykadelic/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
    from /Users/zykadelic/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
    from extconf.rb:184:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/zykadelic/.rvm/gems/ruby-1.9.3-p547/gems/gpgme-2.0.7 for inspection.
Results logged to /Users/zykadelic/.rvm/gems/ruby-1.9.3-p547/extensions/x86_64-darwin-13/1.9.1/gpgme-2.0.7/gem_make.out
ueno commented 9 years ago

Looks like there is something wrong in your GCC installation:

sh: line 1: 47984 Segmentation fault: 11  /usr/local/opt/gcc46/bin/gcc-4.6 -v 2>&1

Can't you work it around by running the gem command with: CC=/usr/bin/gcc gem install ... ?

zykadelic commented 9 years ago

The output is the same. I should note that it installs just fine on my system when I use Ruby 2.x instead of 1.9.3.

Purushotham233 commented 9 years ago

i faced similar issue. When I tried gcc -v , it was complaining xcode path is not available.

$gcc -v xcrun: error: active developer path ("/Volumes/Xcode/Xcode.app/Contents/Developer") does not exist, use xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools (or see man xcode-select)

Then I tried to switch the path. $ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

Check the path after changing path. $xcode-select -p /Applications/Xcode.app/Contents/Developer

zykadelic commented 9 years ago

Did it work for you after changing that? My Xcode install (now updated to 6.2 (6C131e)) seems fine:

$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
$ xcode-select -p
/Applications/Xcode.app/Contents/Developer

Still running into the same error when trying to install the gem.

sergderevyanko commented 9 years ago

Have you resolved issue? I've faced with same and resolve it by execution export GREP_OPTIONS='--color=never' and run gem install after that. In my case problem was caused by grep. It added special symbols for color matched pattern and passed files for father processing. Disabling --color option for grep resolved problem.

zykadelic commented 9 years ago

Thanks for the tip @sergderevyanko, but I’m running into the same error after running export GREP_OPTIONS='--color=never'

zykadelic commented 9 years ago

Now installs just fine...

My guess is that xcode 6.3 fixed it.

LucasArruda commented 5 years ago

brew install gpgme fixes it too

WtfJoke commented 4 years ago

gem install gpgme -- --use-system-libraries <-- fixed it for me

LucasArruda commented 4 years ago

@WtfJoke this worked for me also last time I saw it (on a colleague's computer).