我正在尝试将Ruby / Rails应用更新到Rails 4.2。更新宝石后,我收到superclass mismatch for class MultiBox
错误。代码中没有类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>'
答案 0 :(得分:2)
一位朋友找到了答案:prawn-layout gem现已弃用,其功能已整合到prawn gem中。由于我们的Gemfile需要两个gems,我们得到了“类MultiBox”的“超类不匹配”错误。删除prawn-layout的gem声明可以消除错误。