1

I have installed ruby(1.9.2),gem(1.8.10) and rails(3.1.0), and MYSQL is runnig on WAMP. when I try to install mysql2 0.3.7 gem(gem install mysql2 -v 0.3.7)

when run the following command it shows error

and also tired

C:/dev/Ruby192/bin/ruby.exe extconf.rb --with-mysql-lib="c:\Program File s\MySQL\MySQL Server 5.1\lib\opt" --with-mysql-include="c:\Program Files\MySQL\M ySQL Server 5.1\include"

but looks like i dont have \lib and \include folders in my MYSQL installed directory(in this case D:\wamp\bin\mysql\mysql5.5.8).

please help me installing the mysql gem version greater than 0.3(as I am using Rails 3.1).

Any help will aapreciated.

Thanks Nagendra

Nagendra
  • 21
  • 2
  • Havent tried rails 3.1 plus Mysql on Windows yet, have you tried [this](http://stackoverflow.com/questions/5996834/how-to-install-ruby-on-rails-with-mysql-and-get-it-working-a-step-by-step-guide) – dev Sep 07 '11 at 09:26

3 Answers3

1

For those cases, you should try install either mysql or mysql2 gem against MySQL Connector/C

I've written a tutorial about that:

http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/

Luis Lavena
  • 10,348
  • 1
  • 37
  • 39
0

I am still having problem with mysql2 gem but below approach helped me install mysql with RoR on Windows Env.

Step 1 : Gem File changes : ({app}/Gemfile)

Update mysql2 --> mysql

Step 2 : Updates in database.yml file ({app}/config/database.yml)

Change adapter: mysql2 --> adapter: mysql

    host: localhost -->  host: 127.0.0.1

Step 3 : Downoad mysql-connector-c-noinstall-6.0.2-win32

Step 4 : Copy mysql-connector-c-noinstall-6.0.2-win32\lib\libmysql.dll file to C:\RailsInstaller\Ruby1.9.3\bin

Step 5 :bundle update && Start rails server

Prasanth RJ
  • 137
  • 1
  • 8
0

Install Mysql Connector/C, it provides necessary lib and include files.

Dmitry Maksimov
  • 2,861
  • 24
  • 19