2
我正在尝试执行mysql2的gem安装,但它看起来好像没有找到mysql的安装位置。我在我的Mac上使用XAMPP堆栈安装了mysql。我读了其他职位,但屈服于没有结果。在mac上安装mysql2 gem rails
sudo gem install mysql2 -- --with-mysql-config=/Applications/XAMPP/xamppfiles/bin/mysql_config
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-mysql-config=/Applications/XAMPP/xamppfiles/bin/mysql_config
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... no
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=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
--with-mysql-config
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11 for inspe
我会做brew安装,但我只是想知道它是否会与我现有的XAMPP的mysql安装冲突 – tawheed
XAMPP的mysql实例只有在运行时才会出现。所以如果你退出它,它不应该与brew的mysql冲突。要使它们一起运行,您可以更改XAMPP的端口。另外,在'brew install mysql'之后,请查看指令。它指向如下信息 - 如何在启动后自动启动,停止和运行mysql。 –