I'm trying to deploy my rails app on heroku, but I can't seem to have it recognize my databases/tables as even existing. For some reason, I seem to have translated the problem back locally as well, and now I get the following error:
ActionView::Template::Error (undefined method `strftime' for nil:NilClass):
When I try to execute this command:
<%= result.start_time.strftime("%a at %I:%M%p") %>
This worked previously. now I am trying to run it locally again and it isn't working.
I THINK the problem is that there is no database "results" being recognized, so we are trying to run strftime on a "nil" object. However, I have no clue how to get it to recognize the db, and have been fooling with it for hours. The development.sqlite db is still under the "/db/" folder, and rake db:reset doesn'开发者_Python百科t seem to work. I use the SQLite database browser, and i can SEE the results table. It makes NO sense.
please help.
David
this particular problem is not about db.
Try this:
<%= result.start_time.strftime("%a at %I:%M%p") if result.start_time %>
It means that start_time field is blank. So results table presents, but particular field data doesn't exist.
Maybe, while you were transfering from sqlite3 to postgres DateTime
fields weren't transfered succesfully.
精彩评论