Having issues upon deploying to heroku regarding tables constructed using find statements. They functioned perfectly when using a local server but not there up on heroku I get the ‘were sorry, but something went wrong’ error. I came across some other threads suggesting it may be an issue with case sensitivity in postgresql not that I know much about it but I tried making sure the capitalization was consistent throughout and it didnt seem to make a difference.
Heroku Logs
2012-08-14T00:31:30+00:00 app[web.1]: Processing by ApartmentsController#aptMenu as HTML
2012-08-14T00:31:30+00:00 app[web.1]: Completed 500 Internal Server Error in 4ms
2012-08-14T00:31:30+00:00 app[web.1]:
2012-08-14T00:31:30+00:00 app[web.1]: LINE 1: SELECT "apartments".* FROM "apartments" WHERE (bed = 0)
2012-08-14T00:31:30+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::Error: ERROR: column "bed" does not exist
Controller
def aptMenu
@apartments = Apartment.all
@studio = Apartment.find(:all, :conditions => ["bed = 0"])
Schema
create_table "apartments", :force => true do |t|
t.integer "bed"
Im pretty confused with this seeing as according to everything I can see the ‘bed’ column does exist. Any help would be much appreciated.
This problem occurs because the Apartment table on production database is missing the column Bed. You need to migrate on production side.
heroku rake db:migrateSee if the new column comes up.
Make sure you restart your heroku as well.
heroku restart