我在helpers api_helper文件夹中有一个模块ApiHelper,它引起了一些混乱。在controllers/api/v1中,我有两个控制器,它们都有
include ApiHelper确切的错误是:
/Users/WEF6/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:461:in `load_missing_constant': Circular dependency detected while autoloading constant APIHelper (RuntimeError)我认为发生这个问题是因为我有一个使用rails-api这样设置的api_controller:
class ApiController < ActionController::API我的普通应用程序控制器设置如下
class ApplicationController < ActionController::Base应用程序接口控制器继承自ApiController,而我的普通应用程序控制器继承自ApplicationController。
或者它可能是更简单的东西;想法?
发布于 2015-02-24 23:47:14
我知道这是旧的,但我最近遇到了类似的问题。在我的例子中,问题是在config/initializers/inflections.rb中添加了'API'的词形变化首字母缩写。
为了解决这个问题,我只需将ApiHelper重命名为APIHelper,问题就解决了。
https://stackoverflow.com/questions/21566268
复制相似问题