I am having trouble connecting to mysql database. I'm i missing something? This is my database connection file:
Error thrown:Code:require "mysql2" # error trap begin dbh = Mysql2::new('127.0.0.1','root','','Accounts') rescue Exception => e puts "Unable to connect to database. Error: \"#{e}\"" exit 1 end
What's the best way to connect to mysql database in ruby... not rails... im working on com-line app?Code:Unable to connect to database. Error: "undefined method `new' for Mysql2:Module"



Reply With Quote



Bookmarks