Ruby Mysql Crashing
My ruby code crashes on this code
puts "one"
con = Mysql.real_connect('localhost', 'user', 'pass', 'database')
put开发者_如何学Pythons "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.
精彩评论