我有一个应用程序在开发中工作正常,但是当我将它推到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
你在初始化程序中有什么?任何试图用模型做任何事情的东西?这个错误告诉你,当有东西想要使用你的提交类时,你没有“提交”表。我曾经看到ActiveAdmin是类似案例中的罪魁祸首,但我没有使用它,所以这只是猜测。 –
mu,为Active Admin添加了初始值设定项。那里有什么看起来可疑? –
如果您暂时删除ActiveAdmin,会发生什么情况? –