1
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
它顯示這樣的錯誤。Mysql數據庫連接問題與紅寶石使用寶石'dbi'
救援':未初始化的常量Mysql(NameError)。
幫我看看這個。
你不使用MySQL BU的dbi
寶石
不工作仍然得到這個錯誤。救援':未初始化的常量Mysql(NameError) –
tanay