开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜