Windows 7上安装gem mysql2

直接命令安装会失败
gem install mysql2

按照给出的提示

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'


继续安装,仍然失败,还需要mysql-connector(需要头文件和库文件)。
下载了mysql-connector-c-6.1.2-winx64

gem install mysql2 --platform=ruby -- '--with-mysql-lib="F:\mysql-connector-c-6.1.2-winx64\lib" --with-mysql-include="F:\mysql-connector-c-6.1.2-winx64\include"' 


安装成功

你可能感兴趣的:(windows 7)