【问题标题】:No deprecated_block_helpers in Rails 3.0.5Rails 3.0.5 中没有 deprecated_block_helpers
【发布时间】:2024-05-21 05:40:02
【问题描述】:

当我尝试在 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

在 Rails 中找不到文件 deprecated_block_helpers 似乎有问题。有谁知道如何解决这个问题?

【问题讨论】:

    标签: ruby-on-rails ruby ruby-on-rails-3 production-environment


    【解决方案1】:

    实际上这是 Rails 3.0.5 中的一个错误(已在 edge 中修复)。

    DeprecatedBlockHelpers 在 ActionView::Helpers 中自动加载,但文件本身已在 9de8305 中删除

    此帮助程序旨在显示对某些块使用 <% %> 而不是 <%= %>(或 - 而不是 haml 中的 =)的弃用通知。我不确定弃用的确切内容是什么,但也许可以看看你的模板,看看你是否可以试错才能正常工作。

    或者,您可以供应 Rails 并删除 DeprecatedBlockHelpers 自动加载,或跟踪边缘 Rails。

    【讨论】:

    • 我将尝试更正所有可能导致该弃用的代码。