Rails3 转换后丢失辅助文件错误
我正在将旧的 Rails2.3 项目转换为 3,并且在加载第一页时遇到此运行时错误:
Missing helper file helpers/activesupport.rb
还有其他人遇到过这个吗?看起来助手的加载方式发生了一些变化,但我没有看到任何明显的解决方案。
我能够通过在 app/helpers/activesupport.rb
创建一个空文件来解决这个问题,但我想知道为什么会发生这种情况。
I'm in the midst of converting an old Rails2.3 project to 3, and I'm running into this runtime error when I load the first page:
Missing helper file helpers/activesupport.rb
Has anyone else run into this? Looks like something changed in how helpers are loaded, but I don't see any obvious solutions.
I was able to work around the problem by created an empty file at app/helpers/activesupport.rb
but I would like to know why this is happening in the first place.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
会不会与 ActiveSupport 发生冲突?
我不知道为什么它甚至在寻找这样的助手 - 你有一个名为 activesupport 的模型或控制器吗?
Could it be a clash with ActiveSupport?
I am not sure why its even looking for such a helper - do you have a model or controller called activesupport?
我在 Hpricot 上也遇到了类似的问题。我在助手中有一个
require 'hpricot'
语句,但我的 Gemfile 中没有 Hpricot。就您而言,如果您在某处明确要求 ActiveSupport,则必须将其添加到您的 Gemfile 中(我刚刚尝试过,尽管我的 Gemfile 中有 Rails,但我仍然遇到与您相同的错误)。
I was having a similar issue with Hpricot. I had a
require 'hpricot'
statement in a helper, but I didn't have Hpricot in my Gemfile.In your case, if you were explicitly requiring ActiveSupport somewhere, you would have to add it to your Gemfile (I just tried it and despite having Rails in my Gemfile, I still got the same error you were getting).