Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 3.1 RAils 3.1为什么此查询在开发中工作,而在生产中不工作?_Ruby On Rails 3.1_Sqlite - Fatal编程技术网

Ruby on rails 3.1 RAils 3.1为什么此查询在开发中工作,而在生产中不工作?

Ruby on rails 3.1 RAils 3.1为什么此查询在开发中工作,而在生产中不工作?,ruby-on-rails-3.1,sqlite,Ruby On Rails 3.1,Sqlite,注意:finishDate是事件表中的一个字段 此查询在开发中运行良好 def reminders @events = @user.events.find(:all, :conditions=> ['finishDate >= ?', Time.now]) end 但在生产中会出现这种错误 ActiveRecord::StatementInvalid (PG::Error: ERROR: column "finishdate" does not exist LINE 1: .

注意:finishDate是事件表中的一个字段

此查询在开发中运行良好

def reminders
  @events = @user.events.find(:all, :conditions=> ['finishDate >= ?', Time.now])
end
但在生产中会出现这种错误

ActiveRecord::StatementInvalid (PG::Error: ERROR:  column "finishdate" does not exist
LINE 1: ...vent_id" WHERE "events_users"."user_id" = 13 AND (finishDate...
                                                             ^
heroko控制台

>> Event.last.finishDate
=> Tue, 10 Apr 2012 19:05:00 UTC +00:00

我错过了什么?提前谢谢

您的表似乎没有“finishDate”列。您确定两个表(如果有两个)是相同的吗?可能您手动进行了一些更改,但尚未将其引入生产阵列


此外,更有用的是显示在所选错误摘要旁边的完整SQL查询

finishDate


而且工作得很好

我用heroku控制台的输出编辑了这个问题。看起来有一个finishDate列。关于使用完整SQL查询,您可能是对的。但是,我不知道怎么做。可能是因为使用了驼峰字母=>finishDate。而不是结束约会?
finish_date