1

我有一个使用 cancan 在本地成功运行的 rails 4 应用程序。但是当我将它推送到 Heroku 时,每次代码尝试授权任何东西时都会出现此错误

Uninitialized constant ApplicationController::Ability

查看日志,我的应用程序控制器中的这种方法似乎失败了。知道发生了什么吗?

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

这在我的本地机器上运行良好。

4

1 回答 1

0

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.

于 2013-10-23T00:05:02.730 回答