# The problem of install mysql driver using gem for Rails

**URL:** <https://www.ruby-forum.com/t/the-problem-of-install-mysql-driver-using-gem-for-rails/66071>\
**Category:** Ruby\
**Created:** [February 12, 2006, 7:02am UTC](https://www.ruby-forum.com/t/the-problem-of-install-mysql-driver-using-gem-for-rails/66071 "2006-02-12T07:02:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaoxt1983](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b4bc9f/32.png) [@gaoxt1983](https://www.ruby-forum.com/u/gaoxt1983)\
**Post date:** [February 12, 2006, 7:02am UTC](https://www.ruby-forum.com/t/the-problem-of-install-mysql-driver-using-gem-for-rails/66071/1 "2006-02-12T07:02:50Z")

</div>

No more words, see the console textï¼?

Results logged to c:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7/gem\_make.out

C:\>gem install --remote mysql  
Attempting remote installation of ‘mysql’  
Building native extensions. This could take a while…  
ERROR: While executing gem … (RuntimeError)  
ERROR: Failed to build gem native extension.  
Gem files will remain installed in  
c:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7 for  
inspection.  
ruby extconf.rb install --remote mysql\nchecking for mysql\_query() in  
mysqlcli  
ent.lib… no  
checking for main() in m.lib… yes  
checking for mysql\_query() in mysqlclient.lib… no  
checking for main() in z.lib… no  
checking for mysql\_query() in mysqlclient.lib… no  
checking for main() in socket.lib… no  
checking for mysql\_query() in mysqlclient.lib… no  
checking for main() in nsl.lib… no  
checking for mysql\_query() in mysqlclient.lib… no

Results logged to c:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7/gem\_make.out

---

<div class="post-metadata">

**Author:** ![gaoxt1983](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b4bc9f/32.png) [@gaoxt1983](https://www.ruby-forum.com/u/gaoxt1983)\
**Post date:** [February 12, 2006, 8:07pm UTC](https://www.ruby-forum.com/t/the-problem-of-install-mysql-driver-using-gem-for-rails/66071/2 "2006-02-12T20:07:46Z")

</div>

DÅ?a NedeÄ¾a 12 FebruÃ¡r 2006 07:03 gao zhixin napÃ­sal:

> c:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7 for  
> checking for main() in nsl.lib… no  
> checking for mysql\_query() in mysqlclient.lib… no
> 
> Results logged to c:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7/gem\_make.out

The MySQL driver apparently requires compilation of the native bindings.  
Do  
you have a C compiler installed on your machine and the environment  
variables  
properly setup for the MySQL includes and libraries?

And if you want to answer “Huh?” to the above paragraph, either use a  
win32  
gem if one’s available, ask the people maintaining the driver to make  
one,  
use Cygwin for development, or switch to Postgres which already has  
prebuilt  
mswin32 Ruby bindings available. Oh, and it also owns MySQL

David V.
