[Windows] I have mysql2 (0.3.6): Rails asks for mysql2 (> 0.2.6) and doesn't start

Hello, I’m really new to the Ruby and RoR world, so first of all, hi to
all ^^

Now to the issue explained from the beginning:
I had already installed a MySQL server (xampp)
I installed Ruby from RubyInstaller.
I installed rails from gem.
I installed the DevKit manually.
I installed a MySQL server to copy the libraries and headers to the
XAMPP MySQL installation.
I created a new Rails project with a MySQL server as default.
I tried to start the Rails server and it says “Could not find gem
‘mysql2 (~> 0.2.6, runtime)’ in any of the gem sources listed in your
Gemfile”
I tried a “bundle install” and failed to find MySQL headers to compile.
I succefully installed the mysql2 gem that rails asked for specifying
the MySQL libraries and headers paths.
Rails keeps saying that I need the version 0.2.6 or higher of mysql2
I tried adding -v 0.2.11 (is the version that tries to install during
“bundle install”) to the end of the gem install command while
installing mysql2 and it installed it succefull.
Now when I try to run the rails server it says “Incorrect MySQL client
library version! This gem was compiled for 5.5.14 but the client library
is 6.0.0”

And now I don’t know what should I do =/

EDIT, SOLVED: I found a email group from Google groups that suggested to
copy libmysql.dll from the mysql_installation/lib/ to the
ruby_installation/bin, which now that I think about it makes perfect
sense ^^

Hope this serve as help for anyone with the same problem ^^

On Jul 23, 11:50pm, Ezequiel S. [email protected]
wrote:

I created a new Rails project with a MySQL server as default.
I tried to start the Rails server and it says “Could not find gem
‘mysql2 (~> 0.2.6, runtime)’ in any of the gem sources listed in your
Gemfile”
I tried a “bundle install” and failed to find MySQL headers to compile.
I succefully installed the mysql2 gem that rails asked for specifying
the MySQL libraries and headers paths.
Rails keeps saying that I need the version 0.2.6 or higher of mysql2
I tried adding -v 0.2.6 to the end of the gem install command while
installing mysql2, but it ignored it.

By at the end do you mean you did gem install mysql2 – various build
options -v 0.2.6 ?

if so then that version option is getting passed to the extension
building script, not to gem install. You want gem install mysql2 -v
0.2.6 – various built options.

By the way, ~>0.2.6 means 0.2.x, with x >= 6 so its normal that if you
only have 0.3.6 things don’t work (the 0.3 series of mysql2 require
rails 3.1)

Fred

Frederick C. wrote in post #1012629:

By at the end do you mean you did gem install mysql2 – various build
options -v 0.2.6 ?

if so then that version option is getting passed to the extension
building script, not to gem install. You want gem install mysql2 -v
0.2.6 – various built options.

By the way, ~>0.2.6 means 0.2.x, with x >= 6 so its normal that if you
only have 0.3.6 things don’t work (the 0.3 series of mysql2 require
rails 3.1)

Fred

Great, I didn’t noticed the release candidate, I’m downloading with
–pre right now, thanks ^^