views:

39

answers:

1

I am trying to use the mysql package included in xampp with ruby on rails on windows 7, but cannot seem to get them to work together.

I have rails 3.0.0 and xampp 1.7.3

rails works with sqlite within xampp just fine, but when attempting to use mysql via "rails new project -d mysql; cd project; bundle install"

I get the following:

Installing mysql2 (0.2.4) with native extensions C:/xampp/Ruby192/lib/ruby/1.9.1
/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Fail
ed to build gem native extension. (Gem::Installer::ExtensionBuildError)

C:/xampp/Ruby192/bin/ruby.exe extconf.rb
checking for rb_thread_blocking_region()... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Am I missing anything? All the posts about this issue tell me to use gem install mysql -- --with-mysql-config=PATH, but this does not seem to work with Windows, as I get the same error regardless.

And if it's just not possible, are there any drawbacks to using sqlite now, then trying to migrate the databse over to mysql (or another more robust database) later?

A: 

Did you install the mysql gem?

gem install mysql

After this you need to go to the mysql\bin directory in your XAMPP folder and copy the

libmysql.dll

into your ruby\bin folder.

Give it a try and let me know if it works. Also if your MySql version is 5.1 you may need to download a 5.0 version of the same dll.

tommasop
if i recall correctly, every time that I tried to install the mysql gem, it would throw an error
aperture