Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't install mysql gem on Mac OS X
    primarykey
    data
    text
    <p>I installed the MySQL server with the installer from <a href="http://dev.mysql.com/downloads/mysql" rel="nofollow">http://dev.mysql.com/downloads/mysql</a>. Then, as explained in several guides, I wanted to install the mysql gem with the following command.</p> <pre><code>sudo gem install mysql </code></pre> <p>This is not working and gives the following output.</p> <pre><code>Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /Users/luzi/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb --with-mysql-dir=/usr/local/mysql/ checking for mysql_ssl_set()... *** 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/luzi/.rvm/rubies/ruby-1.9.3-p429/bin/ruby --with-mysql-config --without-mysql-config /Users/luzi/.rvm/rubies/ruby-1.9.3-p429/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/luzi/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0' from /Users/luzi/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:476:in `try_link' from /Users/luzi/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:619:in `try_func' from /Users/luzi/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:894:in `block in have_func' from /Users/luzi/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for' from /Users/luzi/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone' from /Users/luzi/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /Users/luzi/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone' from /Users/luzi/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /Users/luzi/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:280:in `postpone' from /Users/luzi/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for' from /Users/luzi/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:893:in `have_func' from extconf.rb:45:in `&lt;main&gt;' Gem files will remain installed in /Users/luzi/.rvm/gems/ruby-1.9.3-p429/gems/mysql-2.9.1 for inspection. Results logged to /Users/luzi/.rvm/gems/ruby-1.9.3-p429/gems/mysql-2.9.1/ext/mysql_api/gem_make.out </code></pre> <p>I reinstalled ruby 1.9.3 several times. The XCode command line utilities are installed, too. I installed the mysql server with homebrew, too (didn't bring anything).</p> <p>I also tried some options for the command above, like <code>--with-mysql-dir=/usr/local/mysql</code> and <code>--with-mysql-config=/usr/local/mysql/bin/mysql_config</code>. Passing in flags (<code>sudo env ARCHFLAGS="-arch x86_64" gem install mysql</code>) didn't help neither.</p> <p><strong>UPDATE</strong>:</p> <p>I also tried the mysql2 gem, with the result of the same error appearing, probably because the mysql2 gem is dependent on the mysql gem.</p> <p><strong>UPDATE 2</strong>:</p> <p>Content of <code>mkmf.log</code>:</p> <pre><code>"/opt/local/bin/gcc-apple-4.2 -o conftest -I/Users/luzi/.rvm/rubies/ruby-1.9.3-p429/include/ruby-1.9.1/x86_64-darwin12.4.0 -I/Users/luzi/.rvm/rubies/ruby-1.9.3-p429/include/ruby-1.9.1/ruby/backward -I/Users/luzi/.rvm/rubies/ruby-1.9.3-p429/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/opt/local/include -I/usr/local/mysql/include -Wno-null-conversion -Os -g -fno-strict-aliasing -arch x86_64 -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/luzi/.rvm/rubies/ruby-1.9.3-p429/lib -L/opt/local/lib -L. -L/usr/local/lib -L/opt/local/lib -L/usr/local/mysql/lib -lmysqlclient -lruby.1.9.1 -lpthread -ldl -lobjc " cc1: error: unrecognized command line option "-Wno-null-conversion" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: int main(int argc, char **argv) 4: { 5: return 0; 6: } /* end */ </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload