简体   繁体   中英

rails server error,mysql

I'm new at programming on RoR. I ran into an error while trying to launch webrick webserver, on simple RoR project, while typing the following code in the prompt command line:

"rails server"

i got this error:

C:\Users\dell\sites\simple_cms>rails s
C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.
rb:2:in `require': 126:The specified module could not be found.  - C:/Ruby193/lib/ruby/gems/1.9
.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2/mysql2.rb:2:in `<top (required)>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2.rb:9:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2.rb:9:in `<top (required)>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runti
me.rb:68:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runti
me.rb:68:in `block (2 levels) in require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runti
me.rb:66:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runti
me.rb:66:in `block in require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runti
me.rb:55:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/runti
me.rb:55:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler.rb:12
8:in `require'
        from C:/Users/dell/sites/simple_cms/config/application.rb:7:in `<top (re
quired)>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/comman
ds.rb:53:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/comman
ds.rb:53:in `block in <top (required)>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/comman
ds.rb:50:in `tap'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/comman
ds.rb:50:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

I tryied the solution from here (and many others): Ruby mysql2 Error http://railsforum.com/viewtopic.php?id=50501 and they didn't work.

MyDetails:

windows 7 64 bit
mysql  Ver 14.14 Distrib 5.5.28, for Win64 (x86)
ruby 1.9.3p327 (2012-11-10) [i386-mingw32]
Rails 3.2.9
gem 1.8.24

The prompt command: "rails server" is working again, thanks to this link:

http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/

it was very helpfull for installing mysql and rails properly on windows 7 X64.

您需要从MySql安装目录复制libmysql.dll并将其粘贴到ruby193 / bin ...。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM