开发者

Mac OS 10.6 Server can't install mysql gem

开发者 https://www.devze.com 2023-04-11 09:01 出处:网络
I have nearly the same problem with the one discussed on the link below: Error installing Mysql2 gem- 10.6 Server

I have nearly the same problem with the one discussed on the link below:

Error installing Mysql2 gem- 10.6 Server

I have followed the solution described but I get this:

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/r开发者_运维问答ubies/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

Additionally I also tried to specified all mysql path:

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

And still get the error

$ 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

Any help apreciated.


Do you have the mysql header files actually installed in the paths you link to? Have you installed a package of mysql that includes the header file?

/usr/local/mysql

I have installed mysql with ports and I have it in /opt

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

you could try

$ find /usr/local -name mysql.h


I backtracked to version 5.1.59 of mysql instead of 5.5 and it worked fine.

It seems the gem is still incompatible with MySQL 5.5.xx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号