Hartl's rails tutorial completed works locally perfect. Heroku persists “We're sorry, but something went wrong.”

前端 未结 1 1441
闹比i
闹比i 2020-12-21 16:53

I\'m new to Ruby on Rails (new to programming altogether) and this is my first post on stack overflow. I want to thank everyone in advance because I have learned so much fro

相关标签:
1条回答
  • 2020-12-21 17:46

    Sounds to me like you didn't load the schema into your heroku database. After deploying what happens when you do this:

    heroku run rake db:schema:load
    

    Note that sometimes if you're loading up a new app that has an already-established schema, running all the migrations isn't the best way to get the database to the state you want - you should use rake db:schema:load instead. Let me know if this gets your database correct.

    After running it you can use heroku run console and then do console commands like User.all to make sure it knows that the users table exists etc.

    Don't forget to restart your server after loading the schema, or running db:migrate. For heroku that'd be: heroku restart

    0 讨论(0)
提交回复
热议问题