我试图在运行OSX 10.14.1并使用Rails 5.2.2的MacBook上安装mysql2(版本0.5.2)。我已经使用gem install mysql2安装了它,但是没有成功,但是它在我的gem文件中为:
gem 'mysql2'
Run Code Online (Sandbox Code Playgroud)
当我尝试安装gem mysql2时,出现以下错误:
Fetching mysql2 0.5.2
Installing mysql2 0.5.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/lawrence/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/mysql2- 0.5.2/ext/mysql2
/Users/lawrence/.rbenv/versions/2.5.3/bin/ruby -r ./siteconf20181213-11829- 1fv4si0.rb extconf.rb
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for rb_wait_for_single_fd()... yes
-----
Using mysql_config at /usr/local/bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for SSL_MODE_DISABLED in mysql.h... yes
checking for SSL_MODE_PREFERRED in mysql.h... yes
checking for SSL_MODE_REQUIRED in …Run Code Online (Sandbox Code Playgroud)