class MultiBox 的超级class 不匹配(TypeError)

Superclass mismatch for class MultiBox (TypeError)

我正在尝试将 Ruby/Rails 应用程序更新到 Rails 4.2。更新 gems 后,出现 superclass mismatch for class MultiBox 错误。代码中没有 class MultiBox 的本地定义。它是一个单一的代码库(没有 git 合并问题)。这发生在我的本地机器上,尽管它是一个 heroku 部署的应用程序,这是其他情况发生的地方。我在使用旧版本的 prawn-layout (0.7.2) 时遇到了同样的错误。我很欣赏这里的任何想法。

$ rails server
/var/lib/gems/2.2.0/gems/prawn-layout-0.8.4/lib/prawn/layout/grid.rb:191:in `<class:Document>': superclass mismatch for class MultiBox (TypeError)
    from /var/lib/gems/2.2.0/gems/prawn-layout-0.8.4/lib/prawn/layout/grid.rb:2:in `<module:Prawn>'
    from /var/lib/gems/2.2.0/gems/prawn-layout-0.8.4/lib/prawn/layout/grid.rb:1:in `<top (required)>'
    from /var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
    from /var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
    from /var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
    from /var/lib/gems/2.2.0/gems/prawn-layout-0.8.4/lib/prawn/layout.rb:3:in `<top (required)>'
    from /var/lib/gems/2.2.0/gems/bundler-1.8.5/lib/bundler/runtime.rb:85:in `require'
    from /var/lib/gems/2.2.0/gems/bundler-1.8.5/lib/bundler/runtime.rb:85:in `rescue in block in require'
    from /var/lib/gems/2.2.0/gems/bundler-1.8.5/lib/bundler/runtime.rb:68:in `block in require'
    from /var/lib/gems/2.2.0/gems/bundler-1.8.5/lib/bundler/runtime.rb:61:in `each'
    from /var/lib/gems/2.2.0/gems/bundler-1.8.5/lib/bundler/runtime.rb:61:in `require'
    from /var/lib/gems/2.2.0/gems/bundler-1.8.5/lib/bundler.rb:134:in `require'
    from /home/paul/cvtg/config/application.rb:7:in `<top (required)>'
    from /var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `require'
    from /var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `block in server'
    from /var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
    from /var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
    from /var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

一位朋友找到了答案:prawn-layout gem 现已弃用,其功能已合并到 prawn gem 中。因为我们的 Gemfile 需要两个 gems,所以我们得到了 'superclass mismatch for class MultiBox' 错误。删除 prawn-layout 的 gem 声明消除了错误。