3
votes

I'm just starting a new project in Rails and I wanted to add some CanCan roles checking to app. What have I done: 1. Installed proper gem 2. Included in gemfile "cancan" 3. Created ability class 4. In my ApplicationController - added "check_authorization"

But still, I get

undefined local variable or method `authorize_resource' for ApplicationController:Class

or

undefined local variable or method `check_authorization' for ApplicationController:Class

error. Somebody got any ideas what can be the reason why?

My cancan version is 1.6.7. Gem version is 1.9.1

1
Jeez, I'm an idiot. I have done all of this (including installation of a gem) WITHOUT restarting the server. Sorry for making noise. Children, remember - ALWAYS RESTART THE SERVER AFTER GEM INSTALLATION! - Animattronic
thank you for this… I make dumb errors like this all the time - shicholas

1 Answers

2
votes

As the author @Animattronic said, restart your Rails server.