私の開発マシン(windows xp、ROR 3.0.3、SQLite3)ではすべてが正常に機能しました。
アプリケーションを本番サーバー(FreeBSD 8.2-RELEASE、Apache 2.2、ROR 3.0.4、MySQL)に移動すると、このエラーが発生しましたが、新しい登録ページでのみ発生しました。
ログインしようとすると(データベースにユーザーがいない)、パスワードチェックが機能しているようです(パスワードが間違っていると表示されますが、これで問題ありません)。
問題は本番サーバーでのみ発生し、開発サーバーでは問題ありません。どうなり得るか?
ありがとう!
[編集]2011年8月9日追加:
ルート.rb:
#USERS
get "/user/stat"
devise_for :users do
get "/login" => "devise/sessions#new"
get "/logout" => "devise/sessions#destroy"
end
get "/users" => "user#index"
resources :user
registations_controller.rb:
# GET /resource/sign_up
def new
build_resource({})
render_with_scope :new
end
protected
# Build a devise resource passing in the session. Useful to move
# temporary session data to the newly created user.
def build_resource(hash=nil)
hash ||= params[resource_name] || {}
self.resource = resource_class.new_with_session(hash, session)
end
log / Production.log:
Started GET "/users/sign_up" for 192.168.5.7 at 2011-08-09 13:40:31 +0400
Processing by Devise::RegistrationsController#new as HTML
SQL (31.7ms) SHOW TABLES
Completed in 33ms
NoMethodError (undefined method `new_with_session' for #<Class:0x284ac6a8>):
app/controllers/registrations_controller.rb:71:in `build_resource'
app/controllers/registrations_controller.rb:8:in `new'