我在尝试mysql2为Rails 安装gem 时遇到了一些问题.当我尝试通过运行安装它bundle install或gem install mysql2它给我以下错误:
安装mysql2时出错:错误:无法构建gem原生扩展.
我该如何修复并成功安装mysql2?
我按照http://geryit.com/blog/2011/01/installing-mysql-with-rails-on-mac-os-x-snow-leopard/上的说明进行操作,包括通过macport安装ruby.
每当我执行gem install mysql时 ,我都会收到以下错误
bash-3.2# gem install mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/opt/local/bin/ruby extconf.rb
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
*** 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 …Run Code Online (Sandbox Code Playgroud)