1
votes

I have a rails 4 application successfully running locally with cancan. But when I push it to Heroku, I get this error, each time the code tries to authorize anything

Uninitialized constant ApplicationController::Ability

Looking at the logs, it looks like its failing in this method, which I have in my application controller. Any idea what is going on?

  def current_ability
    @current_ability ||= Ability.new(current_user, load_service_provider_from_host)
  end

This works fine on my local machine.

1
anyone has any ideas?Mahesh Guruswamy

1 Answers

0
votes

I managed to figure out what the issue is. The issue was, my ability class file was named Ability.rb. Note the upper case. When I changed it to lower case (ability.rb), just like all the other models, it worked fine. It still would be nice to know why this failed only on heroku and not locally.