최근에 확인 가능한 모듈을 내 레일 앱에 추가했습니다. 내 응용 프로그램은 dev에서 잘 실행됩니다. 그러나, 나는 그것을 영웅에게 밀어 넣을 때, "유감 스럽지만 뭔가 잘못 됐어."라고 말합니다. 다음은 내 히로쿠 로그입니다.heroku rails app 데이터베이스 이전 문제
Rendered devise/confirmations/new.html.erb within layouts/application (2.7ms)
2012-02-03T01:55:07+00:00 app[web.1]: Rendered devise/shared/_links.erb (0.5ms)
2012-02-03T01:55:07+00:00 app[web.1]: cache: [GET /users/confirmation/new] miss
2012-02-03T01:55:07+00:00 app[web.1]: Completed 200 OK in 19ms (Views: 16.9ms | ActiveRecord: 0.0ms)
2012-02-03T01:55:07+00:00 heroku[router]: GET personaldiary.herokuapp.com/users/confirmation/new dyno=web.1 queue=0 wait=0ms service=42ms status=200 bytes=1540
2012-02-03T01:55:11+00:00 app[web.1]:
2012-02-03T01:55:11+00:00 app[web.1]:
2012-02-03T01:55:11+00:00 app[web.1]: Started POST "https://stackoverflow.com/users/confirmation" for 50.131.164.83 at 2012-02-03 01:55:11 +0000
2012-02-03T01:55:11+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"iVVTpWgIrBTR8b9k07lr2tYDFQfAYD0R8JmGVkmfzl4=", "user"=>{"email"=>"[email protected]"}, "commit"=>"Resend confirmation instructions"}
2012-02-03T01:55:11+00:00 app[web.1]: Processing by Devise::ConfirmationsController#create as HTML
2012-02-03T01:55:11+00:00 app[web.1]: Completed 500 Internal Server Error in 4ms
2012-02-03T01:55:11+00:00 app[web.1]:
2012-02-03T01:55:11+00:00 app[web.1]: NameError (undefined local variable or method `confirmed_at' for #<User:0x000000023254e0>):
2012-02-03T01:55:11+00:00 app[web.1]:
2012-02-03T01:55:11+00:00 app[web.1]: cache: [POST /users/confirmation] invalidate, pass
2012-02-03T01:55:11+00:00 app[web.1]:
데이터베이스에는 "confirmed_at"열이 없습니다. 다음과 같이 내 마이그레이션 파일은 다음과 같습니다
class AddConfirmableToDeviseV1 < ActiveRecord::Migration
def up
add_column :users, :confirmation_token, :string
add_column :users, :confirmed_at, :datetime
add_column :users, :confirmation_sent_at , :datetime
add_index :users, :confirmation_token, :unique => true
end
def down
remove_index :users, :confirmation_token
remove_column :users, :confirmation_sent_at
remove_column :users, :confirmed_at
remove_column :users, :confirmation_token
end
end
내 생산은 Heroku가에서 호스팅 :
는 그래서 그것은 나에게 아무런 출력을 포기하지heroku run rake db:migrate
을 달렸다.
은 그 때 나는 그것은
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:dump
,691,363 다음 나에게 또한
== AddConfirmableToDeviseV1: reverting =======================================
-- remove_index(:users, :confirmation_token)
rake aborted!
An error has occurred, this and all later migrations canceled:
Index name 'index_users_on_confirmation_token' on table 'users' does not exist
Tasks: TOP => db:rollback
,
heroku run rake db:migrate --trace
나에게 제공했다
heroku run rake db:rollback
를 실행210
모든 아이디어이 문제를 해결하는 방법?
db : migrate를 --trace와 함께 실행할 수 있으며 출력이 있는지 확인할 수 있습니까? –
** DB를 호출 (first_time) 이전 를 ** 환경 실행 ** 환경 (first_time) 를 호출 ** DB를 호출 : load_config (first_time) 를 ** RAILS_ENV 실행 ** RAILS_ENV (first_time) 를 호출 ** 실행 DB : load_config ** DB를 실행합니다 를 마이그레이션 ** DB 호출 : 스키마를 : 스키마 : load_config ** DB를 실행합니다 을 (first_time) 덤프 ** 환경 를 호출 ** DB를 호출 – riship89
는 여러 응용 프로그램의 설정을 가지고 있나요 덤프 Heroku에서? –