![](/img/trans.png)
[英]Heroku - Rails 3 to 3.1 migration issues with PostgreSQL: relation “users” does not exist
[英]Heroku Ruby On Rails Server Logs says 'Users' does not Exist
我正在关注Ruby On Rails 书籍教程,第 2 章,toy_app
存储库位于 BitBucket, https: //bitbucket.org/Marium36/toy_app/
到目前为止,我可以在本地服务器上打开应用程序,即
localhost:3000
和
localhost:3000/users
heroku 出现问题。
Heroku 应用程序只能打开
https://salty-wave-17330.herokuapp.com/
一旦我尝试
https://salty-wave-17330.herokuapp.com/users
我得到错误,
我们很抱歉,但有些不对劲。 如果您是应用程序所有者,请查看日志以获取更多信息。
服务器日志, https://bitbucket.org/Marium36/toy_app/src/master/heroku_server_logs
显示的持续错误消息是Users
不存在 --- 但它确实存在,我可以在本地计算机中加载,即localhost:3000/users
请帮忙!!!
2019-06-29T11:24:46.008853+00:00 app[web.1]: I, [2019-06-29T11:24:46.008752 #4] INFO -- : [5d839ee1-e92f-46d7-81d0-9fd508157239] Started GET "/users" for PRIVATE_IP at 2019-06-29 11:24:46 +0000
2019-06-29T11:24:46.010267+00:00 app[web.1]: I, [2019-06-29T11:24:46.010188 #4] INFO -- : [5d839ee1-e92f-46d7-81d0-9fd508157239] Processing by UsersController#index as HTML
2019-06-29T11:24:46.013170+00:00 app[web.1]: I, [2019-06-29T11:24:46.013098 #4] INFO -- : [5d839ee1-e92f-46d7-81d0-9fd508157239] Rendering users/index.html.erb within layouts/application
2019-06-29T11:24:46.055431+00:00 app[web.1]: D, [2019-06-29T11:24:46.055315 #4] DEBUG -- : [5d839ee1-e92f-46d7-81d0-9fd508157239] User Load (1.5ms) SELECT "users".* FROM "users"
2019-06-29T11:24:46.056103+00:00 app[web.1]: I, [2019-06-29T11:24:46.056041 #4] INFO -- : [5d839ee1-e92f-46d7-81d0-9fd508157239] Rendered users/index.html.erb within layouts/application (42.8ms)
2019-06-29T11:24:46.056339+00:00 app[web.1]: I, [2019-06-29T11:24:46.056280 #4] INFO -- : [5d839ee1-e92f-46d7-81d0-9fd508157239] Completed 500 Internal Server Error in 46ms (ActiveRecord: 13.4ms)
2019-06-29T11:24:46.057108+00:00 app[web.1]: F, [2019-06-29T11:24:46.057045 #4] FATAL -- : [5d839ee1-e92f-46d7-81d0-9fd508157239]
2019-06-29T11:24:46.063287+00:00 app[web.1]: F, [2019-06-29T11:24:46.057141 #4] FATAL -- : [5d839ee1-e92f-46d7-81d0-9fd508157239] ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "users" does not exist
PG::UndefinedTable: ERROR
表示您尚未创建表。 您需要运行heroku run rake db:migrate
以便将表添加到您的Heroku Postgres
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.