From: Luis Lavena Date: 2010-08-03T07:15:05+09:00 Subject: Re: Installing mysql gem on Win7 x64 for MySQL 5.1.x On Aug 2, 5:16 pm, Geoff Rowell wrote: > As of the time this was written, I'm running: > > * Windows 7 x64 > * mysql Ver 14.14 Distrib 5.1.48, for Win64 (unknown) > * ruby 1.8.7 (2010-06-23 patchlevel 299) [i386-mingw32] > * gem 1.3.7 > > This setup presents a particular problem, because the mysql gem is at > version 2.8.1. That expects to run against a 32-bit version of MySQL > 5.0.x. It also doesn't contain the proper ri/rdoc components. > > Originally, when I tried to install the mysql gem, I ended up with the > Cygwin (mingw32) version of the gem and a whole mess of documentation > warnings. That's not what I wanted! I think this may be because I'm > running an x64 OS, so it can't find a matching platform. No, cygwin != mingw32 Second, you got documentation warnings due old RDoc and missing documentation of mysql gem. Ruby is 32bits, you can't use DLLs that are 64bits, that includes MySQL. You need a 32bits DLL, and more precisely, due MySQL ABI changes, the exact same version used to build the binary gem: 5.0.83 > > Here's what I had to do to get it working: > > 1. Install the mysql Gem > ======================== > Here's the lengthy command line I ended up using: > > --- > C:\>gem install --no-rdoc --no-ri mysql --platform=x86-mswin32 -- > --with-mysql-dir="C:\Program Files\MySQL\MySQL Server 5.1\my.ini" > Successfully installed mysql-2.8.1-x86-mswin32 > 1 gem installed > If you're using Ruby mingw32 version, I would not recommend install mswin32, is the same gem. The command you provided is wrong and do not do what you intend to. > > Since I'm running a 64-bit version of MySQL 5.1, I ended up downloading > the latest "no installer" ZIP file for the 32-bit version of MySQL 5.0. > > * mysql-noinstall-5.0.91-win32.zip > > If you look inside, you'll find "libmysql.dll" in the "bin" directory. > You need to copy this into the "bin" directory of your Ruby > installation. > > Once this is done, you'll find that Ruby is able to talk to the MySQL > database server. You can find this and more accurate details in the RubyInstaller wiki tutorials: http://wiki.github.com/oneclick/rubyinstaller/tutorials -- Luis Lavena