The problem of install mysql driver using gem for Rails

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

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.