Friday 2 December 2011

mysql2 gem installation error in rails3 on Window platform

Window user sometime might have faced this problem of installing mysql2 gem .
>>gem install mysql2


aah, or while  running bundle for your rails app using mysql2
>>bundle install 




Cause of this error is  some inappropriate or missing libmysql libraries which is causing some trouble in compiling step.


To solve this problem you can do either of the following step
1) Install  mysql2 version 0.2.6 instead of 0.2.7 
>>gem install mysql2 -v 0.2.6 


In your gemfile , replace this line
           gem 'mysql2'
with this one

          gem 'mysql2','0.2.6'
 i.e specify version to install

2) Follow this tutorial given at this link

If your problem still persist, don't forget to leave a comment. 

No comments:

Post a Comment