【发布时间】:2012-08-09 04:41:44
【问题描述】:
我们正在使用 prawn 在我们的 rails 3 应用程序中生成 pdf 文件。现在升级到rails 3.2.8后,rails plugin prawnto出现了问题。这是错误:
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them o
ut and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes
for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at D:/rails_proj/
emclab-failed2/config/environment.rb:5)
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern inst
ead. (called from extend at D:/rails_proj/emclab-failed2/vendor/plugins/prawnto/lib/prawnto/template_handler/compile_support.rb:5)
D:/rails_proj/emclab-failed2/vendor/plugins/prawnto/lib/prawnto/template_handlers/base.rb:3:in `<module:TemplateHandlers>': uninitialized co
nstant ActionView::TemplateHandler (NameError)
连rails服务器也无法启动。有没有办法解决这个问题?谢谢。
【问题讨论】:
-
似乎 ActionView::TemplateHandler 在 rails 3.2 中被移除了。 prawnto 似乎有一段时间没有更新了,您可能需要 fork 并修改它才能使用 rails 3.2。
-
如果是这种情况,我们可能会选择为 pdf 使用其他 gem。谢谢。
-
有没有办法在 rails 3.2.8 中只使用 prawn 而没有 prawnto?
-
看起来是这样的:railscasts.com/episodes/…
标签: ruby-on-rails-3 pdf-generation prawn prawnto