PG :: UndefinedTable:错误:在heroku上

时间:2018-05-29 17:35:29

标签: ruby-on-rails heroku

我有一个rails应用程序,用户可以在其中编写引号,而其他用户可以喜欢它们,简单就是这样,一切都在本地运行超精细但是当我在我的heroku应用程序中推送我的代码时,它显示amd异常错误,我已经完成{ {1}}没有任何错误,但现在当我去看引号时假设heroku run rake:migrate我在控制台上收到此错误:

错误

www.example.com/quotes/new

20180527063820_create_quotes.rb

2018-05-29T17:15:29.527333+00:00 app[web.2]: Completed 500 Internal Server Error in 4ms (ActiveRecord: 1.7ms)
2018-05-29T17:15:29.528314+00:00 app[web.2]: 
2018-05-29T17:15:29.528318+00:00 app[web.2]: ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation "quotes" does not exist
2018-05-29T17:15:29.528322+00:00 app[web.2]: LINE 5:                WHERE a.attrelid = '"quotes"'::regclass
2018-05-29T17:15:29.528324+00:00 app[web.2]:                                           ^
2018-05-29T17:15:29.528326+00:00 app[web.2]: :               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
2018-05-29T17:15:29.528328+00:00 app[web.2]:                      pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
2018-05-29T17:15:29.528330+00:00 app[web.2]:                 FROM pg_attribute a LEFT JOIN pg_attrdef d
2018-05-29T17:15:29.528332+00:00 app[web.2]:                   ON a.attrelid = d.adrelid AND a.attnum = d.adnum
2018-05-29T17:15:29.528333+00:00 app[web.2]:                WHERE a.attrelid = '"quotes"'::regclass
2018-05-29T17:15:29.528335+00:00 app[web.2]:                  AND a.attnum > 0 AND NOT a.attisdropped
2018-05-29T17:15:29.528337+00:00 app[web.2]:                ORDER BY a.attnum
2018-05-29T17:15:29.528339+00:00 app[web.2]: ):
2018-05-29T17:15:29.528341+00:00 app[web.2]:   app/controllers/quotes_controller.rb:32:in `new'

quotes_controller.rb

class CreateQuotes < ActiveRecord::Migration
  def change
    create_table :quotes do |t|
      t.string :author
      t.text :quote
      t.text :image_url

      t.timestamps null: false
    end
  end
end

我已经尝试了几乎所有内容,例如重置pg数据库和重新迁移,但直到现在都没有任何帮助。

1 个答案:

答案 0 :(得分:3)

基于此:

LocalAuthentication

看起来你可能没有做过:

relation "quotes" does not exist