2012-09-15 147 views
0

我有一個應用程序在開發中工作正常,但是當我將它推到heroku並試圖運行「heroku run rake db:migrate」時,耙子中止並顯示以下消息:Heroku rake db:migrate aborted

rake aborted! 
PG::Error: ERROR: relation "submissions" does not exist 
LINE 4:    WHERE a.attrelid = '"submissions"'::regclass 
             ^
:    SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull 
       FROM pg_attribute a LEFT JOIN pg_attrdef d 
       ON a.attrelid = d.adrelid AND a.attnum = d.adnum 
      WHERE a.attrelid = '"submissions"'::regclass 
       AND a.attnum > 0 AND NOT a.attisdropped 
      ORDER BY a.attnum 

我不確定從哪裏開始測試。我在模式中找不到問題。耙db:安裝也不起作用。這是我的模式:

ActiveRecord::Schema.define(:version => 20120913202908) do 

    create_table "active_admin_comments", :force => true do |t| 
    t.string "resource_id", :null => false 
    t.string "resource_type", :null => false 
    t.integer "author_id" 
    t.string "author_type" 
    t.text  "body" 
    t.datetime "created_at", :null => false 
    t.datetime "updated_at", :null => false 
    t.string "namespace" 
    end 

    add_index "active_admin_comments", ["author_type", "author_id"], :name => "index_active_admin_comments_on_author_type_and_author_id" 
    add_index "active_admin_comments", ["namespace"], :name => "index_active_admin_comments_on_namespace" 
    add_index "active_admin_comments", ["resource_type", "resource_id"], :name => "index_admin_notes_on_resource_type_and_resource_id" 

    create_table "admin_users", :force => true do |t| 
    t.string "email",     :default => "", :null => false 
    t.string "encrypted_password",  :default => "", :null => false 
    t.string "reset_password_token" 
    t.datetime "reset_password_sent_at" 
    t.datetime "remember_created_at" 
    t.integer "sign_in_count",   :default => 0 
    t.datetime "current_sign_in_at" 
    t.datetime "last_sign_in_at" 
    t.string "current_sign_in_ip" 
    t.string "last_sign_in_ip" 
    t.datetime "created_at",        :null => false 
    t.datetime "updated_at",        :null => false 
    end 

    add_index "admin_users", ["email"], :name => "index_admin_users_on_email", :unique => true 
    add_index "admin_users", ["reset_password_token"], :name => "index_admin_users_on_reset_password_token", :unique => true 

    create_table "categories", :force => true do |t| 
    t.string "name" 
    t.text  "description" 
    t.datetime "created_at", :null => false 
    t.datetime "updated_at", :null => false 
    t.integer "festival_id" 
    end 

    create_table "categories_users", :id => false, :force => true do |t| 
    t.integer "category_id", :null => false 
    t.integer "user_id",  :null => false 
    end 

    create_table "festivals", :force => true do |t| 
    t.date  "opening_date" 
    t.date  "closing_date" 
    t.string "title" 
    t.string "slogan" 
    t.string "tag" 
    t.datetime "submission_start_date" 
    t.datetime "submission_end_date" 
    t.boolean "published" 
    t.datetime "created_at",   :null => false 
    t.datetime "updated_at",   :null => false 
    end 

    create_table "links", :force => true do |t| 
    t.string "name" 
    t.string "url" 
    t.string "kind" 
    t.integer "submission_id" 
    t.datetime "created_at", :null => false 
    t.datetime "updated_at", :null => false 
    end 

    create_table "performers", :force => true do |t| 
    t.string "name" 
    t.string "email" 
    t.integer "submission_id" 
    t.datetime "created_at", :null => false 
    t.datetime "updated_at", :null => false 
    end 

    create_table "submissions", :force => true do |t| 
    t.string "show_title" 
    t.string "group_name" 
    t.string "home_city" 
    t.string "home_theater" 
    t.string "country" 
    t.text  "promotional_description" 
    t.text  "additional_information" 
    t.string "contact_name" 
    t.string "contact_phone" 
    t.string "contact_email" 
    t.boolean "glbt_showcase" 
    t.boolean "diversity_showcase" 
    t.integer "user_id" 
    t.integer "category_id" 
    t.datetime "created_at",    :null => false 
    t.datetime "updated_at",    :null => false 
    end 

    create_table "users", :force => true do |t| 
    t.string "email",     :default => "", :null => false 
    t.string "encrypted_password",  :default => "", :null => false 
    t.string "reset_password_token" 
    t.datetime "reset_password_sent_at" 
    t.datetime "remember_created_at" 
    t.integer "sign_in_count",   :default => 0 
    t.datetime "current_sign_in_at" 
    t.datetime "last_sign_in_at" 
    t.string "current_sign_in_ip" 
    t.string "last_sign_in_ip" 
    t.datetime "created_at",        :null => false 
    t.datetime "updated_at",        :null => false 
    t.string "name" 
    t.string "confirmation_token" 
    t.datetime "confirmed_at" 
    t.datetime "confirmation_sent_at" 
    t.string "unconfirmed_email" 
    t.boolean "curator" 
    end 

    add_index "users", ["email"], :name => "index_users_on_email", :unique => true 
    add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true 

    create_table "venues", :force => true do |t| 
    t.string "name" 
    t.string "address1" 
    t.string "address2" 
    t.string "city" 
    t.string "state" 
    t.string "zip" 
    t.string "box_office_number" 
    t.string "website" 
    t.string "stage_name" 
    t.text  "description" 
    t.string "contact_name" 
    t.string "contact_phone_number" 
    t.string "contact_email" 
    t.datetime "created_at",   :null => false 
    t.datetime "updated_at",   :null => false 
    end 

end 

任何建議我應該在哪裏尋找問題?我應該尋找什麼?

我見過很多類似的問題,但似乎沒有明確的答案來尋找。

UPDATE: 這裏是我的ActiveAdmin初始化:

ActiveAdmin.setup do |config| 
    config.site_title = "Cif4" 
    config.authentication_method = :authenticate_admin_user! 
    config.current_user_method = :current_admin_user 
    config.logout_link_path = :destroy_admin_user_session_path 
    config.batch_actions = true 
end 
+0

你在初始化程序中有什麼?任何試圖用模型做任何事情的東西?這個錯誤告訴你,當有東西想要使用你的提交類時,你沒有「提交」表。我曾經看到ActiveAdmin是類似案例中的罪魁禍首,但我沒有使用它,所以這只是猜測。 –

+0

mu,爲Active Admin添加了初始值設定項。那裏有什麼看起來可疑? –

+0

如果您暫時刪除ActiveAdmin,會發生什麼情況? –

回答

2

有此遭遇的很多人近來由於Heroku的定價和數據庫大小的變化。

如果您的應用有超過10,000行並且您的計劃不夠高,寫入失敗。

我們回答這個是我們必須:

1)選擇higehr計劃,將使40萬行,而不是剛開始只要10000

2)重新指向我們的應用程序到新的數據庫。我沒有參與,但顯然這一步是認爲已經完成,但實際上並沒有,所以如果有必要的話搜索。

+0

我認爲在這一點上,我的種子數據中只有3行。 –

相關問題