我正在编写一些 rake taks 来使用简单的 find 方法查找对象,如下所示:
skill = Mastery.find(:first, :conditions => [ "tree = ? AND tier = ? AND column = ?",
i.to_s,
row_index.to_s,
col_index.to_s
])
这在本地运行良好。但是,当我部署到生产环境时,服务器出现故障并响应以下错误:
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'column = '1') LIMIT 1' at line 1: SELECT `masteries`.* FROM `masteries` WHERE (tree = '1' AND tier = '1' AND column = '1') LIMIT 1
我mysql2
在我的 Rails 应用程序中使用 gem。知道我能做些什么来解决这个问题吗?