[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.6 to the end of the gem install command while installing mysql2, but it ignored it.

There is any chance someone can tell me what to do now? I'm out of ideas =/

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.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 Cheung 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 ^^