Can't install mysql2 without an error message. I've tried every way I can think of including using devkit.
gem install mysql2 -- --with-mysql-include=c:/xampp/mysql/inclu
de --with-mysql-lib=c:/xampp/mysql/lib --with-mysql-config=c:/xampp/mysql/bin/my
sql_config
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby192/bin/ruby.exe extconf.rb --with-mysql-include=c:/xampp/
mysql/include --with-mysql-lib=c:/xampp/mysql/lib --with-mysql-config=c:/xampp/m
ysql/bin/mysql_config
checking for rb_thread_blocking_region()... yes
checking for main() in -llibmysql... no
*** extconf.rb failed ***
Make sure your library points to /lib/opt and not just /lib
Using MySQL with Rails 3 on Windows
Install railsinstaller -> www.railsinstaller.org (I installed it to c:\Rails)
Install MySQL (I used MySQL 5.5) -> dev.mysql.com/downloads/installer/
You will now be able to use your Rails app with MySQL, if you are not sure how to create a Rails 3 app with MySQL read on...
--- Get a Rails 3 app going with MySQL ---
Open command prompt(not Git Bash) -> start/cmd
Navigate to your folder (c:\Sites)
Create new rails app
Delete the file c:\Sites\world\public\index.html
Edit the file c:\Sites\world\config\routes.rb
add this line -> root :to => 'cities#index'
Open command prompt (generate views and controllers)
Edit the file c:\Sites\world\app\models\city.rb to look like this
Edit the file c:\Sites\world\config\database.yml to look like this
Open command prompt windows cmd, not Git Bash(run your app!)
Navigate to your app folder (c:\Sites\world)
Open your browser here -> http://localhost:3000
--- Get a Rails 3 app going with MySQL ---
Just thought I would update this for posterity. With the latest version of the rails installer for windows (as of the date of this post) and using Win 7, and I happen to have xampp installed here was my process. First run and install the rails installer. Now to install the mysql gem I did...
Note that in my configuration I am running xampp, hince I am passing the C:\xampp\mysql as the mysql dir path.
Next copy libmysql.dll from C:\xampp\mysql\lib to C:\RailsInstaller\Ruby1.9.3\bin. Now all the DB related to rails with hopfully 'just work' for you. For instance to create a new rails app with mysql do...
...and you should get your default config/database.yml file already setup to use mysql. Just make sure your username/pw are OK