From: Idealone Ideally on
Hi Guys,
Ruby imposes several way of connecting to Mysql (DBI,activerecord..)
Database using ruby code. Let me know if anybody knows how to connect to
mysql the easiest way.
I am getting all sorts of error trying to connect to mysql. I am using
Windows XP OS.
Hope to hear from you guys soon!!

Cheers
--
Posted via http://www.ruby-forum.com/.

From: Jeff Peng on

> Hi Guys,
> Ruby imposes several way of connecting to Mysql (DBI,activerecord..)
> Database using ruby code. Let me know if anybody knows how to connect to
> mysql the easiest way.


DBI is generally an easy way.
http://www.kitebird.com/articles/ruby-dbi.html

You have to
gem install mysql
gem install dbd-mysql
gem install dbi
before using it.

HTH.


From: Idealone Ideally on
Jeff Peng wrote:
>> Hi Guys,
>> Ruby imposes several way of connecting to Mysql (DBI,activerecord..)
>> Database using ruby code. Let me know if anybody knows how to connect to
>> mysql the easiest way.
>
>
> DBI is generally an easy way.
> http://www.kitebird.com/articles/ruby-dbi.html
>
> You have to
> gem install mysql
> gem install dbd-mysql
> gem install dbi
> before using it.
>
> HTH.

Hi,

On Trying, " gem install mysql " , i get the following error:

C:\Documents and Settings\user1\Desktop>gem install mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

D:/Softwares/ruby/bin/ruby.exe extconf.rb
checking for main() in libmysql.lib... 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 mo
details.

Thanks
--
Posted via http://www.ruby-forum.com/.

From: Jeff Peng on

> On Trying, " gem install mysql " , i get the following error:
>
> C:\Documents and Settings\user1\Desktop>gem install mysql
> Building native extensions. This could take a while...
> ERROR: Error installing mysql:
> ERROR: Failed to build gem native extension.
>
> D:/Softwares/ruby/bin/ruby.exe extconf.rb
> checking for main() in libmysql.lib... 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 mo
> details.

Well, you have to install mysql client before all the operation.
There have to be:

/usr/lib/libmysqlclient.a
/usr/lib/libmysqlclient.so

in my Linux OS.

Jeff.


From: Albert Schlef on
Idealone Ideally wrote:
> Hi Guys,
> Ruby imposes several way[s] of [...] using ruby code.

That's certainly an interesting observation.
--
Posted via http://www.ruby-forum.com/.