[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

MySQL under latest one-click installer

R. Mark Volkmann

4/2/2005 3:58:00 AM

Can it really be this hard to access MySQL from Ruby running under Windows?

Several people have emailed suggestions to me, but none are as simple as
1) download file x from site y
2) unzip file x
3) run this command to install it
4) use this API to access a MySQL database

Maybe the instructions people pointed me to work find under platforms other than
Windows or with other versions of Ruby than what is in the latest one-click
installer.

Accessing MySQL seems like a very basic requirement.
Surely someone working under Windows has needed to do this.

--
R. Mark Volkmann
Partner, Object Computing, Inc.


12 Answers

Lothar Scholz

4/2/2005 4:14:00 AM

0

Hello R.,

RMV> Maybe the instructions people pointed me to work find under platforms other than
RMV> Windows or with other versions of Ruby than what is in the latest one-click
RMV> installer.

RMV> Accessing MySQL seems like a very basic requirement.
RMV> Surely someone working under Windows has needed to do this.

You can use the pure ruby implementation of the mysql client. This one
works fine in a multithreaded application but is much slower. Its just
one file and a "require" statement.

I wish that the one click installer will include a lot more
binary modules in the future (as this is not well covered by
ruby-gems) and not 2 different Editors/Ide's.


--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ru...
CTO Scriptolutions Ruby, PHP, Python IDE 's




james_b

4/2/2005 4:29:00 AM

0

Lothar Scholz wrote:
>
> I wish that the one click installer will include a lot more
> binary modules in the future (as this is not well covered by
> ruby-gems) and not 2 different Editors/Ide's.

Indeed. It is much easier to go get an editor or IDE than it is to get
binary modules.


James



R. Mark Volkmann

4/2/2005 4:56:00 AM

0

Quoting Lothar Scholz <mailinglists@scriptolutions.com>:

> Hello R.,
>
> RMV> Maybe the instructions people pointed me to work find under platforms
> other than
> RMV> Windows or with other versions of Ruby than what is in the latest
> one-click
> RMV> installer.
>
> RMV> Accessing MySQL seems like a very basic requirement.
> RMV> Surely someone working under Windows has needed to do this.
>
> You can use the pure ruby implementation of the mysql client. This one
> works fine in a multithreaded application but is much slower. Its just
> one file and a "require" statement.

I think that will be fine for my needs.

I downloaded ruby-mysql-0.2.6.tar.gz from
http://www.tmtm.org/en/ruby/mysql/READ....

I unzipped it.

I ran "ruby setup.rb" and got
/setup.rb:8:in ``': No such file or directory - mysql_config --socket
(Errno::ENOENT) from ./setup.rb:8

Line 8 contains
sock = `mysql_config --socket`.chomp

I assume mysql_config is supposed to be an executable in the bin directory of
MySQL. It's not in mine. I have version 4.0.20a of MySQL.

Any ideas why the supplied install script doesn't work?

--
R. Mark Volkmann
Partner, Object Computing, Inc.


nobu.nokada

4/2/2005 5:07:00 AM

0

Hi,

At Sat, 2 Apr 2005 13:56:22 +0900,
R. Mark Volkmann wrote in [ruby-talk:136452]:
> I downloaded ruby-mysql-0.2.6.tar.gz from
> http://www.tmtm.org/en/ruby/mysql/READ....

| Setup
|
| % ruby ./setup.rb
|
| This command find MySQL's UNIX domain socket. This is not needed for system that does not have UNIX
| domain socket such as Microsoft Windows.

--
Nobu Nakada


khaines

4/2/2005 6:09:00 AM

0

R. Mark Volkmann wrote:

> Can it really be this hard to access MySQL from Ruby running under
> Windows?
>
> Several people have emailed suggestions to me, but none are as simple as
> 1) download file x from site y
> 2) unzip file x
> 3) run this command to install it
> 4) use this API to access a MySQL database

Yes, it is. I have MySQL running _right now_ on a WinXP box, accessed
through Ruby and DBI, and it was as simple as installing the one-click Ruby
installation. Installing ruby-mysql, and then installing dbi. Simple.


Kirk Haines

Adelle Hartley

4/2/2005 10:35:00 AM

0

Hi Mark,

> Can it really be this hard to access MySQL from Ruby running
> under Windows?
>
> Several people have emailed suggestions to me, but none are
> as simple as

I was previously able to connect to MySQL v 4.0.12 with the Ruby one-click
installer. I recently switched to MySQL v 4.1.9 and suddenly things got
difficult.

I found some instructions which said
1. install DBI
2. configure any databases that you want to access from Ruby, to use "old"
style password authentication (unencrypted).

Even following that advice, I have not been able to connect to MySQL 4.1.9
from Ruby unless the password is blank.

Adelle.




R. Mark Volkmann

4/2/2005 1:53:00 PM

0

Quoting nobu.nokada@softhome.net:

> Hi,
>
> At Sat, 2 Apr 2005 13:56:22 +0900,
> R. Mark Volkmann wrote in [ruby-talk:136452]:
> > I downloaded ruby-mysql-0.2.6.tar.gz from
> > http://www.tmtm.org/en/ruby/mysql/READ....
>
> | Setup
> |
> | % ruby ./setup.rb
> |
> | This command find MySQL's UNIX domain socket. This is not needed for system
> that does not have UNIX
> | domain socket such as Microsoft Windows.

Just to be clear, we're talking about using what is documented at
http://www.tmtm.org/en/ruby/mysql/READ..., not DBI.

So based on your advice I skipped "ruby setup.rb"
"ruby test.rb hostname user passwd" works!
"ruby install.rb" works!

When I run my code I get a dialog from ruby.exe titled "Unable To Locate
Component". It says "This application has failed to start because
mswin32-ruby16.dll was not found. Re-installing the application my fix this
problem."

Is that I file I should have gotten from the one-click installer?
Do I need it?
If so, where can I get it?
Where do I need to put it?

--
R. Mark Volkmann
Partner, Object Computing, Inc.


R. Mark Volkmann

4/2/2005 1:57:00 PM

0

Quoting Kirk Haines <khaines@enigo.com>:

> R. Mark Volkmann wrote:
>
> > Can it really be this hard to access MySQL from Ruby running under
> > Windows?
> >
> > Several people have emailed suggestions to me, but none are as simple as
> > 1) download file x from site y
> > 2) unzip file x
> > 3) run this command to install it
> > 4) use this API to access a MySQL database
>
> Yes, it is. I have MySQL running _right now_ on a WinXP box, accessed
> through Ruby and DBI, and it was as simple as installing the one-click Ruby
> installation. Installing ruby-mysql, and then installing dbi. Simple.

If you go the RAA and search for MySQL, there are three different packages
called mysql-ruby. If I understand correctly, one is for Windows using DBI,
another is for everything else using DBI and the third is for every platform,
but not using DBI.

Can you tell me the URL of the mysql-ruby package that worked for you under
Windows? Do the installation instructions documented at the URL work for you
without modification?

--
R. Mark Volkmann
Partner, Object Computing, Inc.


R. Mark Volkmann

4/2/2005 1:59:00 PM

0

Quoting Adelle Hartley <adelle@bullet.net.au>:

> Hi Mark,
>
> > Can it really be this hard to access MySQL from Ruby running
> > under Windows?
> >
> > Several people have emailed suggestions to me, but none are
> > as simple as
>
> I was previously able to connect to MySQL v 4.0.12 with the Ruby one-click
> installer. I recently switched to MySQL v 4.1.9 and suddenly things got
> difficult.
>
> I found some instructions which said
> 1. install DBI
> 2. configure any databases that you want to access from Ruby, to use "old"
> style password authentication (unencrypted).
>
> Even following that advice, I have not been able to connect to MySQL 4.1.9
> from Ruby unless the password is blank.

Ah ha! Someone else feels my pain. ;-)

Okay, has anyone successfully used MySQL 4.1 or higher under Windows with some
version of mysql-ruby? If so, what is the URL of the mysql-ruby package that
worked for you? Were you able to install it using the documented steps for
that package?

--
R. Mark Volkmann
Partner, Object Computing, Inc.


nobu.nokada

4/2/2005 2:49:00 PM

0

Hi,

At Sat, 2 Apr 2005 22:52:38 +0900,
R. Mark Volkmann wrote in [ruby-talk:136487]:
> When I run my code I get a dialog from ruby.exe titled "Unable To Locate
> Component". It says "This application has failed to start because
> mswin32-ruby16.dll was not found. Re-installing the application my fix this
> problem."

It is an old version DLL.

> Is that I file I should have gotten from the one-click installer?
> Do I need it?
> If so, where can I get it?
> Where do I need to put it?

You might execute wrong version ruby.exe.
a) check your PATH environment variable, and
b) check if old ruby.exe remain anywhere.

--
Nobu Nakada