Newbie - Problem One - Ruby and MySQL

P

page77.office

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
 
X

X-Man

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-mysql.html
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/railsonwindows.html

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

Jon Baer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,201
Messages
2,571,049
Members
47,655
Latest member
eizareri

Latest Threads

Top