自动加载常量时检测到循环依赖 [英] Circular dependency detected while autoloading constant
本文介绍了自动加载常量时检测到循环依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将我的操作系统更新到 Maverics 后,我无法在 Rails 中创建新项目.我总是只看到:
After update my OS to Maverics im unable to make new project in rails. I always see only:
Circular dependency detected while autoloading constant LinksController
或
Unable to autoload constant LinksController, expected
/Users/xxx/DEPLOY/yyyy/app/controllers/links_controller.rb to define it
当我尝试制作时:
<%= link_to 'abc', link_path(f) %>
我的 LinksController 是一个空控制器,只有:
My LinksController is an empty controller with only:
def show
end
怎么了?我无法制作任何新项目.
What is wrong? Im unable to make any new project.
推荐答案
就我而言,我有一个名为 TwitterRETRIEVER 的模块,而 Rails 似乎在寻找 TwitterRetriever.按照 Rails 命名标准更正后,这个问题就没有了.
In my case, I have a module name TwitterRETRIEVER, while Rails seems to looking for TwitterRetriever. After correct this to follow Rails naming standard, this problem is gone.
这篇关于自动加载常量时检测到循环依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文