Note that there are some explanatory texts on larger screens.

plurals
  1. POMySQL Install: ERROR: Failed to build gem native extension
    primarykey
    data
    text
    <p>I'm trying to get MySQL installed to the latest version due to some installation going wrong somewhere along the line. I run the command <code>gem install mysql</code> and I receive the following:</p> <blockquote> <p>Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension.</p> <p>/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb extconf.rb:4: warning: Insecure world writable dir /usr/bin in PATH, mode 040777 extconf.rb:4: warning: Insecure world writable dir /usr/bin in PATH, mode 040777 extconf.rb:7: warning: Insecure world writable dir /usr/bin in PATH, mode 040777 mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h</p> <p>Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out</p> </blockquote> <p>I've searched, and tried a whole host of things, from installing specific versions to trying to reinstall ruby without any luck.</p> <p>Any ideas where I may be going wrong?</p> <p>I'm trying to get MySQL installed to the latest version due to some installation going wrong somewhere along the line. I run the command <code>gem install mysql</code> and I receive the following:</p> <blockquote> <p>Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension.</p> <p>/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb extconf.rb:4: warning: Insecure world writable dir /usr/bin in PATH, mode 040777 extconf.rb:4: warning: Insecure world writable dir /usr/bin in PATH, mode 040777 extconf.rb:7: warning: Insecure world writable dir /usr/bin in PATH, mode 040777 mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h</p> <p>Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out</p> </blockquote> <p>I've searched, and tried a whole host of things, from installing specific versions to trying to reinstall ruby without any luck.</p> <p>Any ideas where I may be going wrong?</p> <p><strong>EDIT</strong>: I installed XCode off my Snow Leopard DVD and the error just changed slightly to the following:</p> <blockquote> <p>Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension.</p> <p>/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb extconf.rb:4: warning: Insecure world writable dir /usr/bin in PATH, mode 040777 extconf.rb:4: warning: Insecure world writable dir /usr/bin in PATH, mode 040777 extconf.rb:7: warning: Insecure world writable dir /usr/bin in PATH, mode 040777 extconf.rb:17: warning: Insecure world writable dir /usr/bin in PATH, mode 040777 checking for mysql_query() in -lmysqlclient... no checking for main() in -lm... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lz... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lsocket... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lnsl... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lmygcc... no checking for mysql_query() in -lmysqlclient... no <strong>* extconf.rb failed *</strong> 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.</p> <p>Provided configuration options: --with-opt-dir --without-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=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby --with-mysql-config --without-mysql-config --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib --with-mysqlclientlib --without-mysqlclientlib --with-mlib --without-mlib --with-mysqlclientlib --without-mysqlclientlib --with-zlib --without-zlib --with-mysqlclientlib --without-mysqlclientlib --with-socketlib --without-socketlib --with-mysqlclientlib --without-mysqlclientlib --with-nsllib --without-nsllib --with-mysqlclientlib --without-mysqlclientlib --with-mygcclib --without-mygcclib --with-mysqlclientlib --without-mysqlclientlib</p> <p>Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out</p> </blockquote> <p>doing "which mysql" on the command line returns nothing, which means it's not recognizing it. I also installed the MySQL system preferences option, and I can't stop MySQL from running. Now I'm completely stuck as what to do!</p> <p><strong>EDIT EDIT</strong></p> <p>I've just completely reinstalled MySQL using this guide <a href="http://hivelogic.com/articles/installing-mysql-on-mac-os-x" rel="noreferrer">http://hivelogic.com/articles/installing-mysql-on-mac-os-x</a></p> <p>Unfortunately this didn't work either, I still receive the same errors. I can't even do mysql -uroot at the command line, I get the error of: </p> <p>ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)</p> <p>So I think I've tried everything.</p> <p>**SOLVED*</p> <p>Sorry guys, the reason for this not working was because of the MySQL paths. I've blogged on it here: <a href="http://www.kieransenior.co.uk/2010/02/mysql-cant-connect-using-ruby-on-rails-mac-os-x-snow-leopard/" rel="noreferrer">http://www.kieransenior.co.uk/2010/02/mysql-cant-connect-using-ruby-on-rails-mac-os-x-snow-leopard/</a></p>
    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.
    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