From: Luis Lavena Date: 2010-01-16T05:05:05+09:00 Subject: Re: Building mysql extension/gem with MinGW (was Re: Gem build issues Ubuntu 9.10 64 bit) On Jan 14, 9:11 pm, Eric Christopherson wrote: > > wrote: > > Since people are talking about the mysql gem, I thought I'd ask how > > you can build it under MinGW. I can't seem to make any combination of > > extconf switches work. > --with-mysql-dir is the only switch that you need, or --with-mysql- include and --with-mysql-lib > > I have the standard Windows mysql-5.1.42-win32 installed in > > /usr/local/mysql. Do I need some MinGW-specific version? (I've tried > > compiling it from source with MSYS/MinGW and also Cygwin, with no > > success.) > You're talking about RubyInstaller and combined with DevKit, correct? If so, then don't install form inside bash or use *nix like paths. If you have MySQL 5.1, you need: 1) RubyInstaller 1.9.1 installed 2) DevKit installed and configured (edit fstab as indicated in the wiki) http://wiki.github.com/oneclick/rubyinstaller/development-kit 3) From a Windows prompt, ensure Ruby and GCC works: ruby -v gcc --version 4) Have MySQL installed and know the path where its library is. If you manually extracted it form the zip, remember the location. 5) proceed to gem installation and indicate the "ruby" platform to force the compilation. Now use the path to MySQL gem install mysql --platform ruby -- --with-mysql-include=C:/mysql/ include --with-mysql-lib=C:/mysql/lib/opt I've indicated "opt" as library because is the "opt"imized version. Please note that extracting or installing MySQL or Ruby or gems in a path with spaces can be a problem. Try avoiding them to all cost. Hope that helps. -- Luis Lavena