Rails 3.0.5 中没有 deprecated_block_helpers
当我尝试在 Rails 3.0.5 上启动生产服务器时,我不断收到此错误:
/var/lib/gems/1.8/gems/activesupport-3.0.5/lib/active_support/core_ext/module/introspection.rb:70:in `const_get': no such file to load -- action_view/helpers/deprecated_block_helpers (LoadError)
from /var/lib/gems/1.8/gems/activesupport-3.0.5/lib/active_support/core_ext/module/introspection.rb:70:in `local_constants'
from /var/lib/gems/1.8/gems/activesupport-3.0.5/lib/active_support/core_ext/module/introspection.rb:70:in `each'
from /var/lib/gems/1.8/gems/activesupport-3.0.5/lib/active_support/core_ext/module/introspection.rb:70:in `local_constants'
from /var/lib/gems/1.8/gems/activesupport-3.0.5/lib/active_support/core_ext/module/introspection.rb:68:in `each'
from /var/lib/gems/1.8/gems/activesupport-3.0.5/lib/active_support/core_ext/module/introspection.rb:68:in `local_constants'
from /var/lib/gems/1.8/gems/activesupport-3.0.5/lib/active_support/core_ext/module/introspection.rb:86:in `local_constant_names'
from /var/lib/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:100:in `new_constants'
from /var/lib/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:91:in `each'
from /var/lib/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:91:in `new_constants'
from /var/lib/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:599:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
from /var/lib/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
from /home/punkweek/punkweek/config.ru:3
from /var/lib/gems/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `instance_eval'
from /var/lib/gems/1.8/gems/rack-1.2.2/lib/rack/builder.rb:46:in `initialize'
from /home/punkweek/punkweek/config.ru:1:in `new'
from /home/punkweek/punkweek/config.ru:1
似乎文件 deprecated_block_helpers 有问题,在 Rails 中找不到该文件。有人知道如何解决这个问题吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上这是 Rails 3.0.5 中的一个错误(已在 Edge 中修复)。
DeprecatedBlockHelpers 在 ActionView::Helpers 中自动加载,但文件本身已在 9de8305
这个助手 中删除旨在显示使用
<% %>
而不是<%= %>
(或-
而不是对于某些块,=
in haml)。我不确定弃用到底是针对哪些块,但也许可以查看一下您的模板,看看是否可以通过反复试验来使其正常工作。或者,您可以供应 Rails 并删除 DeprecatedBlockHelpers 自动加载,或跟踪边缘 Rails。
Actually this is a bug in Rails 3.0.5 (it has been fixed in edge).
DeprecatedBlockHelpers is autoloaded in ActionView::Helpers, but the file itself was removed in 9de8305
This helper was designed to show a deprecation notice for using
<% %>
instead of<%= %>
(or-
instead of=
in haml) for certain blocks. I'm not sure exactly which blocks the deprecation is for, but maybe take a look through your templates and see if you can trial-and-error this into working.Alternatively, you can vendor Rails and remove the DeprecatedBlockHelpers autoload, or track edge Rails.