2011-07-28 14 views
1

ruby​​ 1.8.7で動作する3(3.0.9)のアプリケーションがgem devise(1.4.2)で動作していますコンピュータは完璧に動作します。Heroku [警告] devise_forを提供しましたが、アプリケーションにモデルのユーザーが定義されていません

が、私はHerokuの上でそれをプッシュしようとしたと私はアプリケーションの負荷に次のエラーメッセージが表示されました:

[WARNING] You provided devise_for :users but there is no model User defined in your application 
=> Booting WEBrick 
=> Rails 3.0.9 application starting in production on http://0.0.0.0:43292 
=> Call with -d to detach 
=> Ctrl-C to shutdown server 
Exiting 
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/inflector/methods.rb:124:in `block in constantize': uninitialized constant User (NameError) 
    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/inflector/methods.rb:123:in `each' 
    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/inflector/methods.rb:123:in `constantize' 
    from /app/vendor/bundle/ruby/1.9.1/gems/devise-1.4.2/lib/devise/mapping.rb:84:in `to' 
    from /app/vendor/bundle/ruby/1.9.1/gems/devise-1.4.2/lib/devise/mapping.rb:79:in `modules' 
    from /app/vendor/bundle/ruby/1.9.1/gems/devise-1.4.2/lib/devise/mapping.rb:88:in `strategies' 
    from /app/vendor/bundle/ruby/1.9.1/gems/devise-1.4.2/lib/devise.rb:410:in `block in configure_warden!' 
    from /app/vendor/bundle/ruby/1.9.1/gems/devise-1.4.2/lib/devise.rb:409:in `each_value' 
    from /app/vendor/bundle/ruby/1.9.1/gems/devise-1.4.2/lib/devise.rb:409:in `configure_warden!' 

問題が工夫から来ているが、私はそれを修正する方法がわかりません。 私のモデルのユーザーは正しく定義されており、それは私のコンピュータで動作します... これを修正する方法を知っている人はいますか?あなたが綴られていることを確認するためにあなたのusers.rb内

+1

展開する前にすべてをコミットしましたか? – apneadiving

+0

はい、私はしました。 助けてくれてありがとう。私のモデルでは綴りが正しい。最後に、私は英雄の中で私のアプリを破壊し、それを再び押した...そして今それは正常に動作します。だから私はなぜこれが起こったのか知りません。おそらく私のコミットの1つが正しく行われていなかったでしょう。 しかし、ありがとう! – zelmarou

+0

スペルミスがないかどうかを確認してください。 –

答えて

1

チェックを助けるため

感謝「:database_authenticable」正しく、これは、このエラーに共通の問題であると思われます。

class User < ActiveRecord::Base 
    devise :database_authenticable, :recoverable, 
    :rememberable, :trackable, :validatable 
    # Setup accessible (or protected) attributes for your model 
    attr_accessible :email, :password, :password_confirmation, :remember_me 
end 

また、私はあなたがこれらの人々がエラーを修正方法を確認するために、ここを見てお勧めします。ユーザーの先頭で定義

class User < ActiveRecord::Base 

/モデルを考案: http://groups.google.com/group/plataformatec-devise/browse_thread/thread/807f4c6e3475622f

2

は確かにあなたは、これは持っていることを確認します。

また、移行を必ず実行してください。

heroku rake db:migrate 

コンソールです。

関連する問題