My ruby code crashes on this code
puts "one"
con = Mysql.real_connect('localhost', 'user', 'pass', 'database')
puts "two"
It outputs one but not two?? Why isn't it executing any further
My ruby code crashes on this code
puts "one"
con = Mysql.real_connect('localhost', 'user', 'pass', 'database')
puts "two"
It outputs one but not two?? Why isn't it executing any further
Add require "mysql"
at the beginning.
Also check if you can connect to your database (other than from ruby), just to check that its actually running.
EDIT:
Also, use exception handling to catch these subtle errors.