2011-10-05 3 views
2

J'ai presque le même problème avec celui évoqué sur le lien ci-dessous:Mac OS 10.6 Server ne peut pas installer gem mysql

Error installing Mysql2 gem- 10.6 Server

J'ai suivi la solution décrite mais j'obtenir ceci:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config 
Building native extensions. This could take a while... 
ERROR: Error installing mysql2: 
    ERROR: Failed to build gem native extension. 

     /Users/angelos/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config 
checking for rb_thread_blocking_region()... yes 
checking for mysql.h... no 
checking for mysql/mysql.h... no 
----- 
mysql.h is missing. please check your installation of mysql and try again. 
----- 
*** 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 
    --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=/Users/angelos/.rvm/rubies/ruby-1.9.2-p290/bin/ruby 
    --with-mysql-config 


Gem files will remain installed in /Users/angelos/.rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.7 for inspection. 
Results logged to /Users/angelos/.rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.7/ext/mysql2/gem_make.out 

de plus j'ai essayé aussi spécifié tous les chemins mysql:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- 
--with-mysql-dir=/usr/local/mysql 
--with-mysql-lib=/usr/local/mysql/lib 
--with-mysql-include=/usr/local/mysql/include 
--with-mysql-config=/usr/local/mysql/bin/mysql_config 

Et toujours obtenir l'erreur

$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/bin/mysql_config 
Building native extensions. This could take a while... 
ERROR: Error installing mysql2: 
    ERROR: Failed to build gem native extension. 

     /Users/angelos/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/bin/mysql_config 
checking for rb_thread_blocking_region()... yes 
checking for mysql.h... no 
checking for mysql/mysql.h... no 
----- 
mysql.h is missing. please check your installation of mysql and try again. 
----- 
*** 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 
    --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=/Users/angelos/.rvm/rubies/ruby-1.9.2-p290/bin/ruby 
    --with-mysql-config 


Gem files will remain installed in /Users/angelos/.rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.7 for inspection. 
Results logged to /Users/angelos/.rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.7/ext/mysql2/gem_make.out 

Toute aide apréciée.

+0

Avez-vous installé xcode? Donc, il peut construire l'extension native. –

Répondre

0

Avez-vous les fichiers d'en-tête mysql réellement installés dans les chemins que vous liez? Avez-vous installé un paquet de mysql qui inclut le fichier d'en-tête?

/usr/local/mysql 

J'ai installé MySQL avec des ports et je l'ai dans/opt

$ find /opt -name mysql.h 
/opt/local/include/mysql5/mysql/mysql.h 

vous pouvez essayer

$ find /usr/local -name mysql.h 
+0

tout est installé dans/usr/local/mysql/..., les chemins sont corrects. –

+0

Habituellement, cette erreur provient de libmysqlclient n'étant pas installé, mais si vous avez vérifié qu'il existe réellement un mysql.h à cet emplacement, je suis perplexe. – sunkencity

0

à la version I fait machine arrière 5.1.59 de MySQL au lieu de 5,5 et ça a bien fonctionné.

Il semble que la gemme soit encore incompatible avec MySQL 5.5.xx

Questions connexes