views:

72

answers:

1

I've downloaded the "dbd-mysql-0.4.4.zip" and linked it to my project. While I try to run a demo code from NetBeans the very first line

require "dbi"

gives me an error. Is there a different way to do it?

I also tried jruby setup.rb config --with=dbi,dbd_mysql

from the command prompt and it gave me the following error: config: unknown option --with=dbi,dbd_mysql Try 'ruby setup.rb --help' for detailed usage.

Any suggestions please?

A: 

If you're working with jruby, you need to use dbd-jdbc, because dbd-mysql depends on mysql a native extension (written in C) for Matz' Ruby interpreter.

Install it using rubygems: jruby -S gem install dbi, and add require 'rubygems' as the first line of your code.

Ken Bloom