【求助】Rails3创建应用后,无法启动,怀疑是Mysql驱动的问题
通过rails new xxx -d mysql创建的应用,
在使用rails server启动的时候,无法启动,报如下错误:
F:purasrailsxxx>rails server d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': 193: %1 不是有效 的 Win32 应用程序。 - d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/1.9/mysql2.so (Loa Error) from d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (require )>' from d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2.rb:7:in `require' from d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6-x86-mingw32/lib/mysql2.rb:7:in `<top (required)>' from d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in `require' from d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in `block (2 levels) in r quire' from d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in `each' from d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in `block in require' from d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in `each' from d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in `require' from d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler.rb:112:in `require' from F:/puras/rails/gala/config/application.rb:7:in `<top (required)>' from d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/commands.rb:28:in `require' from d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/commands.rb:28:in `block in <top (requir d)>' from d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/commands.rb:27:in `tap' from d:/Apps/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/commands.rb:27:in `<top (required)>' from script/rails:6:in `require' from script/rails:6:in `<main>'
系统是64位的win7
安装的是rails3
求助!!!!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
同意楼上的看法
还是老老实实在*nix 上运行吧,你解决了这个问题,还是会有其他问题的,有时候因为版本问题,在*nix都会有错,更别说在win下了
mysql2这个gem没有装,而且在windows下很难装的
在网上搜一个RailsFTW装上再试一下
建议在rails new xxx -d mysql后,运行bundle install
引用来自#2楼“JonasBollack”的帖子
你看你mysql2的那个gem的命名,是x86,所以很明显是32位的,但是你的系统是64位的,所以……
你看你mysql2的那个gem的命名,是x86,所以很明显是32位的,但是你的系统是64位的,所以……