本地postrges工作,但似乎无法推动到RAILS_ENV =生产heroku

我的应用程序在localhost:3000上的本地环境中运行得很好。 它从我当地的postgres数据库中提取数据,但我似乎没有更新生产环境。 我的欢迎页面可以在我的https://gcl.herokuapp.com页面上查看,但是当我点击导航链接查看另一个页面时我收到错误,我假设因为该页面调用来自db的数据,它找不到。

我正在做$ rails db:migrate RAILS_ENV=production

我在终端中获得以下输出:

 (0.2ms) SELECT pg_try_advisory_lock(3666737882978712990); ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations" ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]] (0.2ms) BEGIN SQL (1.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "production"], ["updated_at", 2017-03-31 10:42:57 UTC], ["key", "environment"]] (0.4ms) COMMIT (0.2ms) SELECT pg_advisory_unlock(3666737882978712990) 

我的Gemfile中有gem’pg’

我的database.yml看起来像:

 default: &default adapter: postgresql pool: 5 timeout: 5000 development: adapter: postgresql database: postgresql-rectangular-42683 pool: 5 timeout: 5000 test: adapter: postgresql database: postgresql-rectangular-42683 pool: 5 timeout: 5000 production: adapter: postgresql database: postgresql-rectangular-42683 username: Simon password: ************* pool: 5 timeout: 5000` 

有什么想法吗? 现在已经尝试了大约一天的各种事情:(

西蒙

在终端试试这个:

 heroku run rake db:create:all 

然后运行迁移:

 heroku run rake db:migrate 

另外,你可以发布heroku logs的输出

哈哈,两分钟后我发现了问题所在,和往常一样简单。 我需要运行$ heroku run rake db:seed

虽然这似乎只添加了表格,因为我的行仍显示为10000的0

此外,我的页面仍然无法加载到https://gcl.herokuapp.com/articles,但不是100%确定与数据库相关。