Yosemite - Probleme bei der Installation vom MySQL2 Gem

28 December 2014 |   Internet/ PC |   0


Mal wieder einer der typischen Fehler nach einem Update des OS von meinem Macbook. Das Update sowie die Installation vom MySQL2 Gem schlug wie folgt fehl:

sudo gem install mysql2
    Building native extensions.  This could take a while...

    ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

    /Users/xxxx/.rvm/rubies/ruby-2.0.0-p247/bin/ruby -r ./siteconf20141228-5149-143ax3a.rb extconf.rb
checking for ruby/thread.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/xxxx/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
/Users/xxxx/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/xxxx/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:561:in `try_cpp'
    from /Users/xxxx/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:1040:in `block in have_header'
    from /Users/xxxx/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:891:in `block in checking_for'
    from /Users/xxxx/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:336:in `block (2 levels) in postpone'
    from /Users/xxxx/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:306:in `open'
    from /Users/xxxx/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:336:in `block in postpone'
    from /Users/xxxx/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:306:in `open'
    from /Users/xxxx/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:332:in `postpone'
    from /Users/xxxx/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:890:in `checking_for'
    from /Users/xxxx/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:1039:in `have_header'
    from extconf.rb:9:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/xxxx/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/mysql2-0.3.17 for inspection.
Results logged to /Users/xxxx/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/extensions/x86_64-darwin-12/2.0.0/mysql2-0.3.17/gem_make.out`

Wenn euch das auch passiert, dann erst einmal prüfen ob die XCodes installiert sind:

xcode-select -v

Falls ihr hier eine Fehlermeldung bekommt, dann die XCodes wie folgt installieren:

xcode-select --install

Bei mir waren die XCodes aber installiert. Diese habe ich dann versucht wie folgt aufzurufen:

sudo gcc

Erst hier meinte er dann zu mir, das ich den Lizenz Vereinbarungen noch nicht zugestimmt hatte.

You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.

Hierzu dann einfach den Anleitungen folgen und danach konnte ich auch das MySQL2 Gem ohne Probleme installieren.