Incorrect MySQL client library version

15,004

Solution 1

There seem to be several questions on here already about this. Did you try their solutions?

Probably the most clear is this: mysql2 gem compiled for wrong mysql client library

The pertinent part is here:

At the time of building this gem, the necessary DLL files where available
in the following download:

http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick

And put lib\libmysql.dll file in your Ruby bin directory, for example
C:\Ruby\bin

Solution 2

This will remove the gem and its dependencies. Then reinstalling will re-compile itself and all dependencies.

gem uninstall mysql2
bundle install
Share:
15,004
mhopkins321
Author by

mhopkins321

Updated on June 13, 2022

Comments

  • mhopkins321
    mhopkins321 almost 2 years

    I created a new rails project calling

    rails new simple_cms 
    

    Then when in the directory I run

    rails s
    

    I get the follow errors

    C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/l
    ib/mysql2/mysql2.rb:2:in `require': Incorrect MySQL client library version! This
    gem was compiled for 6.0.0 but the client library is 5.5.24. (RuntimeError)
        from C:/RailsInstaller/Ruby1.9.3/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.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-
    x86-mingw32/lib/mysql2.rb:9:in `require'
        from C:/RailsInstaller/Ruby1.9.3/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.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/
    lib/bundler/runtime.rb:68:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/
    lib/bundler/runtime.rb:68:in `block (2 levels) in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/
    lib/bundler/runtime.rb:66:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/
    lib/bundler/runtime.rb:66:in `block in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/
    lib/bundler/runtime.rb:55:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/
    lib/bundler/runtime.rb:55:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/
    lib/bundler.rb:119:in `require'
        from c:/development/ruby/simple_cms/config/application.rb:7:in `<top (re
    quired)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.3
    /lib/rails/commands.rb:53:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.3
    /lib/rails/commands.rb:53:in `block in <top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.3
    /lib/rails/commands.rb:50:in `tap'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.3
    /lib/rails/commands.rb:50:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'
    

    I have seen other people with this error but they tend to be linux users and I am running windows. I have attempted to reinstall both rails (railsinstaller.org) and mysql 5.5. I have used both the 32bit version as well as the 64bit version