Ruby:无法加载oracle驱动程序

时间:2010-12-30 11:41:48

标签: ruby oracle dbi

我是红宝石初学者并且出现以下错误。

Driver: dbi:Oracle:
/Library/Ruby/Site/1.8/dbi/dbi.rb:511:in `load_driver': Could not load driver (no such file to load -- oracle) (DBI::InterfaceError)
    from /Library/Ruby/Site/1.8/dbi/dbi.rb:429:in `data_sources'
    from /tmp/list-ruby-dbsupport.rb:4
    from /tmp/list-ruby-dbsupport.rb:2:in `each'
    from /tmp/list-ruby-dbsupport.rb:2

这是我的脚本(list-ruby-dbsupport.rb):

require 'dbi'
DBI.available_drivers.each do |driver| 
    puts "Driver: " + driver 
    DBI.data_sources(driver).each do |dsn|  
        puts "  Datasource: " + dsn 
    end
end

我正在使用Mac,我刚刚使用以下命令安装了dbi(安装过程中没有抛出错误)

ruby setup.rb config –-with=dbi,dbd_oracle,dbd_mysql

我也安装了dbd-mysql-0.4.4和dbd-odbc-0.2.5 - 希望这可能会修复错误,但它没有。 谁能告诉我如何修理或在哪里检查?

1 个答案:

答案 0 :(得分:1)

您安装了ruby-oci8库吗?