【发布时间】:2016-05-03 04:25:37
【问题描述】:
我最近安装了 Ruby on rails 和 MySQL。
版本是 ruby 2.1.7 和 MySQL Workbench 6.3 CE。
我输入了gem install mysql2 -v=0.2.6,这发生了;
Fetching: mysql2-0.2.6.gem <100%>
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
Error: Failed to build gem native extensions.
C:/Ruby21/bin/ruby.exe extconf.rb
checking for rb_thread_blocking_region()... yes
checkimg for main() in -llibmysql... 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 may
need configuration options.
Provided configuration option:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdit
--ruby=C:Ruby21/bin/ruby
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-libmysqllib
--without-libmysqllib
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby21/lib/ruby/gems/2.1.0/gems/mysql2-0.2
.6 for inspection.
Results logged to C:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/mys
ql2-0.2.6/gem_make.out
谁能帮我把 Ruby on rails 和 MySQL 连接起来?
【问题讨论】:
-
只在你的 gem 文件中包含 gem 'mysql2' 对你不起作用?
-
ㄴchaitanya;该怎么做?
标签: mysql ruby-on-rails ruby windows