# Gem install mysql

**URL:** <https://www.ruby-forum.com/t/gem-install-mysql/149776>\
**Category:** Ruby\
**Created:** [September 29, 2008, 7:18pm UTC](https://www.ruby-forum.com/t/gem-install-mysql/149776 "2008-09-29T19:18:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![reddvinylene](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4af34b/32.png) [@reddvinylene](https://www.ruby-forum.com/u/reddvinylene)\
**Post date:** [September 29, 2008, 7:18pm UTC](https://www.ruby-forum.com/t/gem-install-mysql/149776/1 "2008-09-29T19:18:31Z")

</div>

I’m having some problems installing the MySQL Ruby gem here on Cygwin.  
Anybody know what’s up?

$ uname -a  
CYGWIN\_NT-5.1 papaia 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin

$ gem install mysql  
Building native extensions. This could take a while…  
ERROR: Error installing mysql:  
ERROR: Failed to build gem native extension.

/usr/bin/ruby.exe extconf.rb install mysql  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lm… yes  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lz… yes  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lsocket… no  
checking for mysql\_query() in -lmysqlclient… no  
checking for main() in -lnsl… no  
checking for mysql\_query() in -lmysqlclient… no  
\*\*\* 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.

Provided configuration options:  
–with-opt-dir  
–without-opt-dir  
–with-opt-include  
–without-opt-include=${opt-dir}/include  
–with-opt-lib  
–without-opt-lib=${opt-dir}/lib  
–with-make-prog  
–without-make-prog  
–srcdir=.  
–curdir  
–ruby=/usr/bin/ruby  
–with-mysql-config  
–without-mysql-config  
–with-mysql-dir  
–without-mysql-dir  
–with-mysql-include  
–without-mysql-include=${mysql-dir}/include  
–with-mysql-lib  
–without-mysql-lib=${mysql-dir}/lib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-mlib  
–without-mlib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-zlib  
–without-zlib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-socketlib  
–without-socketlib  
–with-mysqlclientlib  
–without-mysqlclientlib  
–with-nsllib  
–without-nsllib  
–with-mysqlclientlib  
–without-mysqlclientlib

Gem files will remain installed in  
/usr/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.  
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.7/gem\_make.out

I guess this is a bit pathetic:

$ gem install mysql – --with-mysql-config="/cygdrive/c/Program  
Files/MySQL/MySQL Server 5.0/bin/MySQLInstanceConfig.exe"  
Building native extensions. This could take a while…  
ERROR: Error installing mysql:  
ERROR: Failed to build gem native extension.

/usr/bin/ruby.exe extconf.rb install mysql –  
–with-mysql-config=/cygdrive/c/Program Files/MySQL/MySQL Server  
5.0/bin/MySQLInstanceConfig.exe  
extconf.rb:1: command not found: /cygdrive/c/Program --cflags  
\*\*\* 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.

Provided configuration options:  
–with-opt-dir  
–without-opt-dir  
–with-opt-include  
–without-opt-include=${opt-dir}/include  
–with-opt-lib  
–without-opt-lib=${opt-dir}/lib  
–with-make-prog  
–without-make-prog  
–srcdir=.  
–curdir  
–ruby=/usr/bin/ruby  
–with-mysql-config

Gem files will remain installed in  
/usr/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.  
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.7/gem\_make.out

---

<div class="post-metadata">

**Author:** ![reddvinylene](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4af34b/32.png) [@reddvinylene](https://www.ruby-forum.com/u/reddvinylene)\
**Post date:** [September 29, 2008, 10:05pm UTC](https://www.ruby-forum.com/t/gem-install-mysql/149776/2 "2008-09-29T22:05:29Z")

</div>

On Sep 29, 7:16 pm, Redd V. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> \*\*\* extconf.rb failed \*\*\*  
> –without-opt-lib=${opt-dir}/lib  
> –without-mysql-include=${mysql-dir}/include  
> –with-mysqlclientlib  
> Gem files will remain installed in
> 
> ```
> --with-opt-dir
> --with-mysql-config
> 
> ```
> 
> Gem files will remain installed in  
> /usr/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.  
> Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.7/gem\_make.out
> 
> –[http://www.home.no/reddvinylene](http://www.home.no/reddvinylene)

you need mysql source files to be able to build the mysql ruby gem.  
There are lot of information dealing with this cygwin issue. Try  
google it.  
For start look at:

> **[Run Ruby, Gems, Rails, MySQL and RMagick on Cygwin](http://xiaoboonrails.blogspot.com/2008/02/run-ruby-gems-rails-and-mysql-on-cygwin.html)**
>
> Before using cygwin, I did not expect that the commands of rails do not work in cygwin. To make ruby, gems and rails to work, there are some...

---

<div class="post-metadata">

**Author:** ![reddvinylene](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4af34b/32.png) [@reddvinylene](https://www.ruby-forum.com/u/reddvinylene)\
**Post date:** [September 30, 2008, 8:42am UTC](https://www.ruby-forum.com/t/gem-install-mysql/149776/3 "2008-09-30T08:42:35Z")

</div>

On Mon, Sep 29, 2008 at 10:04 PM, Dejan D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> you need mysql source files to be able to build the mysql ruby gem.  
> There are lot of information dealing with this cygwin issue. Try  
> google it.  
> For start look at: [Xiaobo On Rails: Run Ruby, Gems, Rails, MySQL and RMagick on Cygwin](http://xiaoboonrails.blogspot.com/2008/02/run-ruby-gems-rails-and-mysql-on-cygwin.html)

Thank you so much man 😉
