Forum: Ruby installing mysql for ruby purposes (windows)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ff0f8dd0d90d244459c4178d72dc5a50?d=identicon&s=25 Andrew Buchan (bfsog)
on 2006-05-04 20:27
I have Ruby version 1.8.4 on XP SP 2.

I installed Mysql Server 5.0.2 - this worked fine.

I then tried some code like

require "mysql"

That code failed, I searched and found I have to run extconf.rb

My question is, according to http://www.tmtm.org/en/mysql/ruby/ I need
to add a path to the end of extconf.rb, such as

ruby extconf.rb --with-mysql-dir=/usr/local/mysql

I have ruby installed at c:\ruby
And mysql installed at c:\program files\mysql

What will be the path?

Totally lost here,

Thanks.
F0223b1193ecc3a935ce41a1edd72e42?d=identicon&s=25 zdennis (Guest)
on 2006-05-04 21:41
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Buchan wrote:
> My question is, according to http://www.tmtm.org/en/mysql/ruby/ I need
> to add a path to the end of extconf.rb, such as
>
> ruby extconf.rb --with-mysql-dir=/usr/local/mysql
>
> I have ruby installed at c:\ruby
> And mysql installed at c:\program files\mysql
>
> What will be the path?
>
> Totally lost here,

    http://www.tmtm.org/en/mysql/ruby/

The above link points to a ruby extension for mysql that is written in
C. It has to be compiled. Compiling it on windows is a real
 pain. The "ruby extconf.rb ..." command is used to start compiling the
extension.

   http://www.tmtm.org/en/mysql/ruby/

This link is the pure-ruby version of the driver. It doesn't need to
compiled. The easiest way to get this is probably by typing
at a command prompt:

   gem install mysql

You should be able to test this by opening a command prompt and typing
"irb" and hitting enter. Then try:

   require 'mysql'
   Mysql.client_info

If that errors and you did the "gem install mysql" previously then try:

   require 'rubygems'
   require 'mysql'
   Mysql.client_info

HTH,

Zach

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEWlh/Myx0fW1d8G0RAgn+AJ0RuIIPMZbYWgwjgLaWanM/m1J0YQCcC2uM
gZAmaFSqe6qAM9k1dfCZ8gw=
=l7fE
-----END PGP SIGNATURE-----
A0ed1bbfe42f4f87e6db0a16706246e2?d=identicon&s=25 Michael Greenly (mgreenly)
on 2006-05-04 22:16
> The above link points to a ruby extension for mysql that is written in
> C. It has to be compiled. Compiling it on windows is a real
>  pain. The "ruby extconf.rb ..." command is used to start compiling the
> extension.
>
>    http://www.tmtm.org/en/mysql/ruby/
>

The ruby for apache project has a precompiled version included.

http://rubyforge.org/frs/?group_id=477&release_id=2501

Run the installer only select the mysql part

I'm not sure who's but this is but you have to make sure that the
msql\bin entry in your path environment variable is set and if it's the
last entry it must have a semi colon at the end otherwise somethings not
finding it.
B35e9113d2d517beb19ebd9eeb4d77be?d=identicon&s=25 Jon Dean (Guest)
on 2006-05-05 00:12
>    http://www.tmtm.org/en/mysql/ruby/
>
> This link is the pure-ruby version of the driver. It doesn't need to
> compiled. The easiest way to get this is probably by typing
> at a command prompt:
>
>    gem install mysql
>
> You should be able to test this by opening a command prompt and typing
> "irb" and hitting enter. Then try:
>
>    require 'mysql'
>    Mysql.client_info
>
> If that errors and you did the "gem install mysql" previously then try:
>
>    require 'rubygems'
>    require 'mysql'
>    Mysql.client_info
>
> HTH,
>
> Zach

Ok, I'm having the same problem getting mysql to work with ruby.  I
tried your approach.  When I entered gem install mysql I get a few
options.  I chose the second option "mysql 2.7 (ruby)" and got the
following error:

Failed to gem native extension

As expected, both test options failed.  When I tried require 'rubygems'
in irb it returned false.  I also saw the message concerning the
rubyapache download but am not sure what apache is.  Any thoughts?


Jon
E9858a1070ab57b8cf068e8f9d54bb4a?d=identicon&s=25 charl (Guest)
on 2006-05-11 13:17
Andrew Buchan wrote:

> I then tried some code like
>
> require "mysql"
>
> That code failed, I searched and found I have to run extconf.rb
>

hi i also had issues with ruby/mysql, if ruby and mysql are working
independantly but don't talk to each other, you might want to check this
out:http://www.ruby-forum.com/topic/8061#3353

check this out to read article i started when i was having my mysql
problems:
http://www.ruby-forum.com/topic/61253#63952

i personally never installed any C code modules and i never ran
extconf.rb - this may be what you are looking for, however i'm still
hoping to find out why this solved my problems(if there are any people
out there who might know'maybe it's cos i never ran etconf.rb, i'm not
willing  to find out though')

 good luck
This topic is locked and can not be replied to.