tags:

views:

385

answers:

3

I tried to do

gem install mysql

but there is an error. "Could not create Makefile due to some reason..."

How do I fix this? I believe I installed mysql on cygwin. Help!!

A: 

Unfortunately, you may have to recompile MySQL to obtain the necessary library files.

eswald
Anything after that?
bobsanders123
+1  A: 
  • First, download the MySQL source code - you'll want the same version as whatever MySQL version you already have running (I'm using 5.1.42, which is the current binary from the MySQL Web site, but select whatever you need here: MySQL Snapshots)
  • Second, find a copy of ttydefaults.h and copy it into your /usr/include/sys - this one is fine: ttydefaults.h. When I say grab it and put it in, I mean literally either use wget or type:

vi /usr/include/sys/ttydefaults.h

and paste it in

  • Third, go into your mysql source directory, and type ./configure --without-server --without-readline. Wait until this finishes.
  • Fourth, go into your mysql/libmysql directory, and type make install.
  • Fifth, go into your mysql/include directory and type:

cp mysqld_error.h /usr/local/include/mysql/

  • Next type:

gem install mysql

  • Finally, go into your source directory for ruby, and make sure all items where you want to connect to "localhost" have "host: 127.0.0.1" instead of leaving the host off. If you leave the host blank, or leave it as local host, you will get a /tmp/mysql.sock error.
aronchick
Thanks for the thorough response! I got hung up on the 3rd instruction though... even with the "without-readline" flag, it dies with this: configure: error: Could not find system readline or libedit libraries Use --with-readline or --with-libedit to use the bundled versions of libedit or readline
tlianza
A: 

gem install mysql --platform x86-mingw32 works in cygwin

knx