【发布时间】:2017-08-20 12:53:32
【问题描述】:
当我运行gem install mysql2 命令时,我收到以下错误消息:
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
...
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.
...
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/lucivaldo/.rvm/gems/ruby-2.4.0/extensions/x86_64-linux/2.4.0/mysql2-0.4.9/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/lucivaldo/.rvm/gems/ruby-2.4.0/gems/mysql2-0.4.9 for inspection.
Results logged to /home/lucivaldo/.rvm/gems/ruby-2.4.0/extensions/x86_64-linux/2.4.0/mysql2-0.4.9/gem_make.out
查看消息末尾描述的日志文件,我注意到缺少一些库。
如何解决这个问题?
【问题讨论】: