草庐IT

inverval

全部标签

ruby-on-rails - 平均每小时 inverval - Rails

[信息:Ubuntu14.02、ruby2.2.3p110、Rails4.2.1]我需要一个rake任务来从数据库(SQLite)中获取每小时范围内[例如00:00到00:59]的平均插入量。我试图做类似的事情:namespace:dbdotaskresults::environmentdotweet=Tweet.group('date(created_at)').group('hour(created_at)').average()puts"#{tweet}"endend但这抛出这个异常ActiveRecord::StatementInvalid:SQLite3::SQLExcept