【发布时间】:2016-02-22 13:03:49
【问题描述】:
gem 'dbi'
require 'dbi'
begin
con = Mysql.new 'localhost', 'root', '1234'
puts con.get_server_info
rs = con.query 'SELECT VERSION()'
puts rs.fetch_row
rescue Mysql::Error => e
puts e.errno
puts e.error
ensure
con.close if con
end
它显示这样的错误。
rescue in ': 未初始化的常量 Mysql (NameError)。
帮我解决这个问题。
【问题讨论】: