[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Newbie - Problem One - Ruby and MySQL

page77.office

1/4/2006 9:50:00 PM

I have ruby, apache and MySQL installed via instantrailson Windows XP
sp2. All work independently OK.

I am attempting to access the MySQL, but up to now no success.

After searching the web. have tried

require 'dbi'

require 'mysql'

but both have not been found. What is the correct require '' and a
pointer to a code snippet, which connected to a database and select
rows would be most helpful.

It may be something to do with 'activerecord, but
require 'active_record' does not find any code either.

Thanks

Richard

2 Answers

X-Man

1/4/2006 11:53:00 PM

0

There is no native Ruby to MySQL adapter under Windows. That is why
each of the pieces work independently, but you are frustrated. (This is
why I use Sqlite3 instead of MySQL) You can build your own adapter
under Cygwin, apparently, but I think it's too much pain for the
reward.

If you must, here's the link from the guy who wrote a book on MySQL ...
http://www.kitebird.com/articles/ruby-...
Search for the word "Windows".

And here's some complex (but good?) instructions on how to set up the
whole enchilada for Eclipse, which seems to include a way to get at the
database without Cygwin. The JDBC connector seems to be involved - not
sure. ...
http://www.napcs.com/howto/railsonwi...

Hope this helps --- And if you do decide to build some adapter for
Windows, upload it for us ;-)

Jon Baer

1/5/2006 1:37:00 AM

0

If it is a gem you should do:

require 'rubygems'
require 'mysql' (etc)

If im not mistake you should adjust your RUBY_LIB env path to point to
your site_ruby directory. (so require can find packages ok)

- Jon