rails3 mysql2安装

1.windows下安装mysql2的命令:gem install mysql2 -v 0.2.6 --platform x86-mingw32 
2.成功安装了mysql2,  将gemfile中改为:gem 'mysql2', '0.2.6'   
3.database.yml 中adapter 改回mysql2
4.复制Mysql5 server端的libmysql.dll文件,到Ruby安装目录下的bin文件夹中,即可解决~


请教:windows ruby1.92 Rails3 gem install mysql2

09-02

相关文件都能下载到gmes目录里,但无法创建成功,当然,gem list里面也没有rn下面是问题描述,不是太理解该如何解决,请教达人相助,万分感谢。rn好像rails3是默认采用mysql2适配器,有没有办法改变啊。rn[quote]rnBuilding native extensions. This could take a while...rnERROR: Error installing mysql2:rn ERROR: Failed to build gem native extension.rnrnC:/Ruby/bin/ruby.exe extconf.rbrnchecking for rb_thread_blocking_region()... *** extconf.rb failed ***rnCould not create Makefile due to some reason, probably lack ofrnnecessary libraries and/or headers. Check the mkmf.log file for morerndetails. You may need configuration options.rnrnProvided configuration options:rn --with-opt-dirrn --without-opt-dirrn --with-opt-includern --without-opt-include=$opt-dir/includern --with-opt-librn --without-opt-lib=$opt-dir/librn --with-make-progrn --without-make-progrn --srcdir=.rn --curdirrn --ruby=C:/Ruby/bin/rubyrnC:/Ruby/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)rnYou have to install development tools first.rn from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'rn from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:440:in `try_link'rn from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:552:in `try_func'rn from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:797:in `block in have_func'rn from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'rn from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'rn from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:254:in `open'rn from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'rn from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:254:in `open'rn from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'rn from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'rn from C:/Ruby/lib/ruby/1.9.1/mkmf.rb:796:in `have_func'rn from extconf.rb:9:in ` 'rnrnrnGem files will remain installed in C:/Ruby/lib/ruby/gems/1.9.1/gems/mysql2-0.2.3 for inspection.rnResults logged to C:/Ruby/lib/ruby/gems/1.9.1/gems/mysql2-0.2.3/ext/mysql2/gem_make.outrn[/quote]

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试

关闭