Wide view: 

Installing Ruby on Rails 4, Ruby 2.0 and the MySQL2 gem on Windows 7

tags: People


Tharaka AbeyratneI'm getting an error when I run the scafold command C:\Dev\hello_wld>rails g scaffold user first_name:string last_name:string email:string C:/Ruby200/lib/ruby/gems/2.0.0/bundler/gems/mysql2-2fd036972235/lib/mysql2.rb:9: in `require': Incorrect MySQL client library version! This gem was compiled for 5.7.3-m13 but the client library is 6.1.2. (RuntimeError) Please help. Thank you.

MainOffenderKZfor the fast reponse**

nLarge100fffuuuuuuu.. this is fu@#&$ frustrating... on 21:03 when i put 'rake db:migrate' shows 'rake aborted! Incorrect MySql client library version! This gem was compiled for 5.7.2-m12 but the client library is 6.1.1 C:/dev/hello_world/config/application.rb:7:in 'top required' C:/dev/hello_world/Rakefile:4:in 'top required' dafuqq is this?!

Jonathan MacDonaldBe sure to install the 32bit version of Ruby and then download the correct version of the MySQL connector. (I've included the link to the MySQL connector download in the description.) Note, these instructions seem to be confusing for a number of people. I hope to create a new set of videos this week that will break down the steps, with verification of each along the way. Hopefully that will help. Good luck!

MainOffenderKZruby 2.0.0p247 (2013-06-27) [x64mingw32] and im on a 64 bit windows

Jonathan MacDonaldNo problem, go to 14:48 -- that's where I'm editing the Gemfile. Replace 0.3.11 with 0.3.13.

nLarge100Hey man! My problem is: on 06:47 when i type ruby dk.rb install i get : Invalid configuration or no Rubies listed. Please fix 'config.yml' and rerun ' ruby dk.rb install' .What shoul i do?? please help!!

Jonathan MacDonaldWould you be able to send me a message and the contents of your Gemfile?

Jonathan MacDonaldHi -- hang in there! :) Two things, 1) did you download the previous version of the connector? Take a look at 1:23 of the video -- make sure to download version 6.0.1. And 2) can you send me the contents of your Gemfile? Feel free to send me a message.

Anaximandro AndradeI had the same problem but even restarting it doesn't solve the problem!

1caballeronegrounable to conver from ascii-8bit to utf-8 for lib/mysql2/1.9/mysql2.so

Andrés Giesenowjust like danilo83rocks, I restarted the computer and the problem is solved!! GREAT TUTORIAL!! thaks a lot!

MainOffenderKZok good, I unistall everything and did it again in 32 bit, didnt ran into a single prob!! a+++ job!

Jonathan MacDonaldHi Anaximandro. Can you copy and paste the exact line from your Gemfile where you reference github and the MySQL2 gem?

Jonathan MacDonaldAt the command prompt, type 'ruby -v' Can you send me the result of that command?

Catirau Mihailfor those who use numeric mysql user passwords in database.yml find line --> password: 12345 (where 12345 you database password) change to --> password : '12345' (just add single quotes)

triplem731Hi Jonathan Many thanks for the great video, had one or two problems installing it like a Javascript runtime error - I downloaded node.js and it worked a treat :) Many Thanks again, Seán.

Gabriel DzulThanks a lot. it worked for me. Your great..

Mandark Darkhey jonathan thanks for the video. I am stuck here, while i am trying to execute this code rails new hello -d mysql -D (11:19) at the end of code system is running the "bundle install" command and it is not allowing to complete the process i am getting this error message " ExtensionBuildError: ERROR: Failed to build gem native extension" and An error occurred while installing mysql2 (0.3.13), and Bundler cannot cont Make sure that `gem install mysql2 -v '0.3.13'` succeeds before bundling.

AntraczekI reinstall all again, now everthing in 32 bit edition, now it works. I don't know whats wrong with the 64 bit version of ruby, devkit, mysqlconnector.

Omkar Kakadegem install rails -v-4.0.0 --no-ri --no-rdoc this command doesn't work for me. so i have changed to gem install rails -v4.0.0 --no-ri --no-rdoc will it affect my next step.

Jonathan MacDonaldHey, glad to help. Can you send me your config.yml file? (or the content of it). And, what's the location to your Ruby installation? What happens when you type 'ruby -v' at the command prompt?

Jonathan MacDonaldIt doesn't look like you downloaded the correct version of the MySQL connector. Make sure the version you're downloading is 6.0.2.

1caballeronegroI follow the instructions, i have an error when running the script test.rb, in the line 2 require mysql, i use windows 7 and x64 architecture, im thinking on install ubuntu or fedora or whatever XD

this1is1megem install rails -v-4.0.0 --no-ri --no-rdoc it says : while executing gem ... Gem::Requirement::BadRequirementError Illformed requirement ["-4.0.0"] what is wrong?