I've moved an application onto the production server, and found that when I run it under the production environment active_rbac doesn't work (it's fine under the development environment). I find this in the logs when trying to view a protected page: NoMethodError (undefined method `before_filter' for ActiveRbac::ComponentController:Class): /app/controllers/active_rbac/component_controller.rb:2 ...lots more stuff... The offending code is: class ActiveRbac::ComponentController before_filter :protect_with_active_rbac protected def protect_with_active_rbac # only protect certain controllers return true if [ActiveRbac::LoginController, ActiveRbac::RegistrationController, ActiveRbac::MyAccountController].include?(self.class) # protect! if !session[:rbac_user_id].nil? and User.find_by_id(session[:rbac_user_id]).has_role?("Admin") return true else flash[:notice] = "Please log in to access this page." redirect_to "/login" return false end end end Can anyone suggest where I might begin to look for the cause of this error?
on 2007-03-08 15:12