1

Topic: I can't get the server to run

I followed a tutorial to install everything. I'm pretty much done but I can't get mysql to work. I have tried a few different fixes I have read but none of them work. I imagine it's something simple but I can't figure it out.

This is what I get when I type rails server.



C:\Users\me\Documents\Sites\simple_cms>rails server
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/l
ib/mysql2/mysql2.rb:2:in `require': 193: %1 is not a valid Win32 application.
- C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32
/lib/mysql2/1.9/mysql2.so (LoadError)
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-
x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-
x86-mingw32/lib/mysql2.rb:9:in `require'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-
x86-mingw32/lib/mysql2.rb:9:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.21
/lib/bundler/runtime.rb:68:in `require'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.21
/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.21
/lib/bundler/runtime.rb:66:in `each'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.21
/lib/bundler/runtime.rb:66:in `block in require'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.21
/lib/bundler/runtime.rb:55:in `each'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.21
/lib/bundler/runtime.rb:55:in `require'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.21
/lib/bundler.rb:122:in `require'
        from C:/Users/me/Documents/Sites/simple_cms/config/application.rb:7
:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.1
/lib/rails/commands.rb:52:in `require'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.1
/lib/rails/commands.rb:52:in `block in <top (required)>'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.1
/lib/rails/commands.rb:49:in `tap'
        from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.1
/lib/rails/commands.rb:49:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

Re: I can't get the server to run

Did you download the necessary DLL files available in the following download:

  http://dev.mysql.com/get/Downloads/Conn … /from/pick

Put lib\libmysql.dll file in your Ruby bin directory, for example C:\Ruby\bin, run bundle
and try again.

Last edited by Javix (2012-04-23 07:37:36)

3

Re: I can't get the server to run

That worked!

I had already found a very similar (maybe the same) solution and done a step like that but it must have been a different libmysql.dll. I'm pretty sure I had copied it from the bin\ folder and not lib\

Anyway, thank you. I knew it was something simple that I was doing wrong.