windows下进行rails安装

主要是参考:http://www.admin10000.com/Document/140.html


x:/>rails new work --database mysql
错误信息如下:
extconf failed, exit code 1


Gem files will remain installed in D:/BillFiles/rails_dev/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.15 for inspection.
Results logged to D:/BillFiles/rails_dev/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/mysql2-0.3.15/gem_make.out
An error occurred while installing mysql2 (0.3.15), and Bundler cannot continue.


Make sure that `gem install mysql2 -v '0.3.15'` succeeds before bundling.


找遍google,都是ubuntu的命令行,主要是更新libmysqlclient-dev。
参考:http://stackoverflow.com/questions/3608287/error-installing-mysql2-failed-to-build-gem-native-extension


x:/>gem install mysql2 -- '--with-mysql-lib="C:\Program Files\MySQL\MySQL Server 5.6\lib" --with-mysql-include="C:\Program Files\MySQL\MySQL Server 5.6\include"'


将C:\Program Files\MySQL\MySQL Server 5.6\lib\libmysql.dll复制到ruby/bin目录下。
执行:x:/>rails new work --database mysql
成功!

你可能感兴趣的:(ror)