先安装oracle instantclient.
gem install ruby-oci8
提示失败:
cd /Users/g/lib/instantclient_11_2
ln -s libclntsh.dylib.11.1 libclntsh.dylib
require "oci8"
conn = OCI8.new('tmp','tmp','tmp')
cursor = conn.exec('SELECT * FROM dict ')
while r = cursor.fetch()
puts r.join(',')
end
cursor.close
conn.logoff
参考:
http://ruby-oci8.rubyforge.org/en/
dbi接口