【求助】Rails3创建应用后,无法启动,怀疑是Mysql驱动的问题

puras 发布于 2010/11/15 20:17
阅读 1K+
收藏 2

通过rails new xxx -d mysql创建的应用,

在使用rails server启动的时候,无法启动,报如下错误:

F:\puras\rails\xxx>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

求助!!!!!!

加载中
0
WalleZhang
WalleZhang

你看你mysql2的那个gem的命名,是x86,所以很明显是32位的,但是你的系统是64位的,所以……

0
puras
puras

引用来自#2楼“JonasBollack”的帖子

你看你mysql2的那个gem的命名,是x86,所以很明显是32位的,但是你的系统是64位的,所以……

木有64位的GEM么?

唉。。。。

0
40hood
40hood

mysql2这个gem没有装,而且在windows下很难装的

在网上搜一个RailsFTW装上再试一下

建议在rails new xxx -d mysql后,运行bundle install

0
s
samqiu

还是老老实实在*nix 上运行吧,你解决了这个问题,还是会有其他问题的,有时候因为版本问题,在*nix都会有错,更别说在win下了

0
castiel
castiel
同意楼上的看法
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部
返回顶部
顶部