wicked_pdf_stylesheet_link_tag 'application' 抛出 404 错误
wicked_pdf_stylesheet_link_tag 'application' throwing 404 error
我在使用 wicked_pdf 时遇到了一个奇怪的错误。
我的 mac 从未遇到过同样的问题,
但是在我的生产 centos 6.6 vps 上,它抛出 404 错误 在线:
wicked_pdf_stylesheet_link_tag 'application'
我正在使用
gem 'rails', '4.1.6'
gem 'wkhtmltopdf-binary'
gem 'wicked_pdf', '~> 0.11.0'
我尝试将 application.css.scss
或 application.css
添加到 initializer/assets.rb
Rails.application.config.assets.version = '1.1'
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )
Rails.application.config.assets.precompile += %w(*.svg *.eot *.woff *.ttf *.gif *.png *.ico)
Rails.application.config.assets.precompile += %w(application.css *.js *.css *.js.coffee)
但还是不行,
有人知道可以做什么吗?
在我的 ubuntu 14 服务器上用作开发 machine,
wicked_pdf_image_tag object.file1.file.path
似乎导致 pdf 生成器挂起。
我已经评论了它,它有效。我已经检查过路径是否正确。
image_tag helper 也会出现此问题,但在以 html 格式显示时工作正常。
完整跟踪显示:
/usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:353:in
open_http'
/usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:724:in
buffer_open'
/usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:210:in
block in open_loop'
/usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:208:in
catch'
/usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:208:in
open_loop'
/usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:149:in
open_uri'
/usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:704:in
open'
/usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:34:in
open' wicked_pdf (0.11.0) lib/wicked_pdf/wicked_pdf_helper.rb:111:in
read_from_uri' wicked_pdf (0.11.0)
lib/wicked_pdf/wicked_pdf_helper.rb:100:in
read_asset' wicked_pdf
(0.11.0) lib/wicked_pdf/wicked_pdf_helper.rb:40:in block in
wicked_pdf_stylesheet_link_tag' wicked_pdf (0.11.0)
lib/wicked_pdf/wicked_pdf_helper.rb:38:in
collect' wicked_pdf
(0.11.0) lib/wicked_pdf/wicked_pdf_helper.rb:38:in
wicked_pdf_stylesheet_link_tag' app/views/layouts/pdf.html.slim:5:in
_app_views_layouts_pdf_html_slim___1321156534865974876_43089880'
actionview (4.1.6) lib/action_view/template.rb:145:in block in
render' activesupport (4.1.6)
lib/active_support/notifications.rb:161:in
instrument' actionview
(4.1.6) lib/action_view/template.rb:339:in instrument' actionview
(4.1.6) lib/action_view/template.rb:143:in
render' actionview (4.1.6)
lib/action_view/renderer/template_renderer.rb:67:in
render_with_layout' actionview (4.1.6)
lib/action_view/renderer/template_renderer.rb:53:in
render_template'
actionview (4.1.6) lib/action_view/renderer/template_renderer.rb:17:in
render' actionview (4.1.6) lib/action_view/renderer/renderer.rb:42:in
render_template' actionview (4.1.6)
lib/action_view/renderer/renderer.rb:23:in render' actionview (4.1.6)
lib/action_view/rendering.rb:99:in
_render_template' actionpack
(4.1.6) lib/action_controller/metal/streaming.rb:217:in
_render_template' actionview (4.1.6)
lib/action_view/rendering.rb:82:in
render_to_body' actionpack (4.1.6)
lib/action_controller/metal/rendering.rb:32:in render_to_body'
actionpack (4.1.6) lib/action_controller/metal/renderers.rb:32:in
render_to_body' actionpack (4.1.6)
lib/abstract_controller/rendering.rb:43:in render_to_string'
actionpack (4.1.6) lib/action_controller/metal/rendering.rb:21:in
render_to_string' wicked_pdf (0.11.0)
lib/wicked_pdf/pdf_helper.rb:34:in render_to_string_with_wicked_pdf'
wicked_pdf (0.11.0) lib/wicked_pdf/pdf_helper.rb:61:in
make_pdf'
wicked_pdf (0.11.0) lib/wicked_pdf/pdf_helper.rb:32:in
render_to_string_with_wicked_pdf'
app/controllers/concerns/has_pdf_response.rb:15:in
respond_to_pdf'
app/controllers/quotations_controller.rb:23:in block (2 levels) in
show' actionpack (4.1.6)
lib/action_controller/metal/mime_responds.rb:258:in
call' actionpack
(4.1.6) lib/action_controller/metal/mime_responds.rb:258:in
respond_to' app/controllers/quotations_controller.rb:20:in
show'
actionpack (4.1.6) lib/action_controller/metal/implicit_render.rb:4:in
send_action' actionpack (4.1.6)
lib/abstract_controller/base.rb:189:in
process_action' actionpack
(4.1.6) lib/action_controller/metal/rendering.rb:10:in
process_action' actionpack (4.1.6)
lib/abstract_controller/callbacks.rb:20:in
block in process_action'
activesupport (4.1.6) lib/active_support/callbacks.rb:113:in call'
activesupport (4.1.6) lib/active_support/callbacks.rb:113:in
call'
activesupport (4.1.6) lib/active_support/callbacks.rb:166:in block in
halting' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
block in halting' activesupport (4.1.6)
lib/active_support/callbacks.rb:149:in
call' activesupport (4.1.6)
lib/active_support/callbacks.rb:149:in block in
halting_and_conditional' activesupport (4.1.6)
lib/active_support/callbacks.rb:229:in
call' activesupport (4.1.6)
lib/active_support/callbacks.rb:229:in block in halting'
activesupport (4.1.6) lib/active_support/callbacks.rb:229:in
call'
activesupport (4.1.6) lib/active_support/callbacks.rb:229:in block in
halting' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
block in halting' activesupport (4.1.6)
lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6)
lib/active_support/callbacks.rb:166:in block in halting'
activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call'
activesupport (4.1.6) lib/active_support/callbacks.rb:166:in block in
halting' activesupport (4.1.6) lib/active_support/callbacks.rb:229:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:229:in
block in halting' activesupport (4.1.6)
lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6)
lib/active_support/callbacks.rb:166:in block in halting'
activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call'
activesupport (4.1.6) lib/active_support/callbacks.rb:166:in block in
halting' activesupport (4.1.6) lib/active_support/callbacks.rb:229:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:229:in
block in halting' activesupport (4.1.6)
lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6)
lib/active_support/callbacks.rb:166:in block in halting'
activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call'
activesupport (4.1.6) lib/active_support/callbacks.rb:166:in block in
halting' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
block in halting' activesupport (4.1.6)
lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6)
lib/active_support/callbacks.rb:166:in block in halting'
activesupport (4.1.6) lib/active_support/callbacks.rb:86:in
call'
activesupport (4.1.6) lib/active_support/callbacks.rb:86:in
run_callbacks' actionpack (4.1.6)
lib/abstract_controller/callbacks.rb:19:in
process_action' actionpack
(4.1.6) lib/action_controller/metal/rescue.rb:29:in process_action'
actionpack (4.1.6)
lib/action_controller/metal/instrumentation.rb:31:in
block in
process_action' activesupport (4.1.6)
lib/active_support/notifications.rb:159:in block in instrument'
activesupport (4.1.6)
lib/active_support/notifications/instrumenter.rb:20:in
instrument'
activesupport (4.1.6) lib/active_support/notifications.rb:159:in
instrument' actionpack (4.1.6)
lib/action_controller/metal/instrumentation.rb:30:in
process_action'
actionpack (4.1.6)
lib/action_controller/metal/params_wrapper.rb:250:in process_action'
activerecord (4.1.6)
lib/active_record/railties/controller_runtime.rb:18:in
process_action' actionpack (4.1.6)
lib/abstract_controller/base.rb:136:in process' actionview (4.1.6)
lib/action_view/rendering.rb:30:in
process' actionpack (4.1.6)
lib/action_controller/metal.rb:196:in dispatch' actionpack (4.1.6)
lib/action_controller/metal/rack_delegation.rb:13:in
dispatch'
actionpack (4.1.6) lib/action_controller/metal.rb:232:in block in
action' actionpack (4.1.6)
lib/action_dispatch/routing/route_set.rb:82:in
call' actionpack
(4.1.6) lib/action_dispatch/routing/route_set.rb:82:in dispatch'
actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:50:in
call' actionpack (4.1.6) lib/action_dispatch/journey/router.rb:73:in
block in call' actionpack (4.1.6)
lib/action_dispatch/journey/router.rb:59:in
each' actionpack (4.1.6)
lib/action_dispatch/journey/router.rb:59:in call' actionpack (4.1.6)
lib/action_dispatch/routing/route_set.rb:678:in
call' rack-pjax
(0.8.0) lib/rack/pjax.rb:12:in call' warden (1.2.3)
lib/warden/manager.rb:35:in
block in call' warden (1.2.3)
lib/warden/manager.rb:34:in catch' warden (1.2.3)
lib/warden/manager.rb:34:in
call' rack (1.5.2) lib/rack/etag.rb:23:in
call' rack (1.5.2) lib/rack/conditionalget.rb:25:in
call' rack
(1.5.2) lib/rack/head.rb:11:in call' remotipart (1.2.1)
lib/remotipart/middleware.rb:27:in
call' actionpack (4.1.6)
lib/action_dispatch/middleware/params_parser.rb:27:in call'
actionpack (4.1.6) lib/action_dispatch/middleware/flash.rb:254:in
call' rack (1.5.2) lib/rack/session/abstract/id.rb:225:in context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in
call' actionpack
(4.1.6) lib/action_dispatch/middleware/cookies.rb:560:in call'
activerecord (4.1.6) lib/active_record/query_cache.rb:36:in
call'
activerecord (4.1.6)
lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in
call' actionpack (4.1.6)
lib/action_dispatch/middleware/callbacks.rb:29:in
block in call'
activesupport (4.1.6) lib/active_support/callbacks.rb:82:in
run_callbacks' actionpack (4.1.6)
lib/action_dispatch/middleware/callbacks.rb:27:in
call' actionpack
(4.1.6) lib/action_dispatch/middleware/reloader.rb:73:in call'
actionpack (4.1.6) lib/action_dispatch/middleware/remote_ip.rb:76:in
call' actionpack (4.1.6)
lib/action_dispatch/middleware/debug_exceptions.rb:17:in call'
actionpack (4.1.6)
lib/action_dispatch/middleware/show_exceptions.rb:30:in
call'
railties (4.1.6) lib/rails/rack/logger.rb:38:in call_app' railties
(4.1.6) lib/rails/rack/logger.rb:20:in
block in call' activesupport
(4.1.6) lib/active_support/tagged_logging.rb:68:in block in tagged'
activesupport (4.1.6) lib/active_support/tagged_logging.rb:26:in
tagged' activesupport (4.1.6)
lib/active_support/tagged_logging.rb:68:in tagged' railties (4.1.6)
lib/rails/rack/logger.rb:20:in
call' actionpack (4.1.6)
lib/action_dispatch/middleware/request_id.rb:21:in call' rack (1.5.2)
lib/rack/methodoverride.rb:21:in
call' rack (1.5.2)
lib/rack/runtime.rb:17:in call' activesupport (4.1.6)
lib/active_support/cache/strategy/local_cache_middleware.rb:26:in
call' rack (1.5.2) lib/rack/lock.rb:17:in call' actionpack (4.1.6)
lib/action_dispatch/middleware/static.rb:64:in
call' rack (1.5.2)
lib/rack/sendfile.rb:112:in call' railties (4.1.6)
lib/rails/engine.rb:514:in
call' railties (4.1.6)
lib/rails/application.rb:144:in call' passenger (4.0.56)
lib/phusion_passenger/rack/thread_handler_extension.rb:74:in
process_request' passenger (4.0.56)
lib/phusion_passenger/request_handler/thread_handler.rb:141:in
accept_and_process_next_request' passenger (4.0.56)
lib/phusion_passenger/request_handler/thread_handler.rb:109:in
main_loop' passenger (4.0.56)
lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in
start_threads'
事实证明,当我调用时,我指向了我的图像的绝对路径
wicked_pdf_image_tag
该函数实际上指向
root_path.join('public', '图片')
解决方案是创建一个新方法或只使用此代码:
image_tag "file://absolute_path_to_img_here",选项
[http://www.rubydoc.info/github/mileszs/wicked_pdf/WickedPdfHelper%3Awicked_pdf_image_tag][1]
我在使用 wicked_pdf 时遇到了一个奇怪的错误。
我的 mac 从未遇到过同样的问题, 但是在我的生产 centos 6.6 vps 上,它抛出 404 错误 在线:
wicked_pdf_stylesheet_link_tag 'application'
我正在使用
gem 'rails', '4.1.6'
gem 'wkhtmltopdf-binary'
gem 'wicked_pdf', '~> 0.11.0'
我尝试将 application.css.scss
或 application.css
添加到 initializer/assets.rb
Rails.application.config.assets.version = '1.1'
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )
Rails.application.config.assets.precompile += %w(*.svg *.eot *.woff *.ttf *.gif *.png *.ico)
Rails.application.config.assets.precompile += %w(application.css *.js *.css *.js.coffee)
但还是不行,
有人知道可以做什么吗?
在我的 ubuntu 14 服务器上用作开发 machine,
wicked_pdf_image_tag object.file1.file.path
似乎导致 pdf 生成器挂起。
我已经评论了它,它有效。我已经检查过路径是否正确。
image_tag helper 也会出现此问题,但在以 html 格式显示时工作正常。
完整跟踪显示:
/usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:353:in
open_http' /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:724:in
buffer_open' /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:210:inblock in open_loop' /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:208:in
catch' /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:208:inopen_loop' /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:149:in
open_uri' /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:704:inopen' /usr/local/rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/open-uri.rb:34:in
open' wicked_pdf (0.11.0) lib/wicked_pdf/wicked_pdf_helper.rb:111:inread_from_uri' wicked_pdf (0.11.0) lib/wicked_pdf/wicked_pdf_helper.rb:100:in
read_asset' wicked_pdf (0.11.0) lib/wicked_pdf/wicked_pdf_helper.rb:40:inblock in wicked_pdf_stylesheet_link_tag' wicked_pdf (0.11.0) lib/wicked_pdf/wicked_pdf_helper.rb:38:in
collect' wicked_pdf (0.11.0) lib/wicked_pdf/wicked_pdf_helper.rb:38:inwicked_pdf_stylesheet_link_tag' app/views/layouts/pdf.html.slim:5:in
_app_views_layouts_pdf_html_slim___1321156534865974876_43089880' actionview (4.1.6) lib/action_view/template.rb:145:inblock in render' activesupport (4.1.6) lib/active_support/notifications.rb:161:in
instrument' actionview (4.1.6) lib/action_view/template.rb:339:ininstrument' actionview (4.1.6) lib/action_view/template.rb:143:in
render' actionview (4.1.6) lib/action_view/renderer/template_renderer.rb:67:inrender_with_layout' actionview (4.1.6) lib/action_view/renderer/template_renderer.rb:53:in
render_template' actionview (4.1.6) lib/action_view/renderer/template_renderer.rb:17:inrender' actionview (4.1.6) lib/action_view/renderer/renderer.rb:42:in
render_template' actionview (4.1.6) lib/action_view/renderer/renderer.rb:23:inrender' actionview (4.1.6) lib/action_view/rendering.rb:99:in
_render_template' actionpack (4.1.6) lib/action_controller/metal/streaming.rb:217:in_render_template' actionview (4.1.6) lib/action_view/rendering.rb:82:in
render_to_body' actionpack (4.1.6) lib/action_controller/metal/rendering.rb:32:inrender_to_body' actionpack (4.1.6) lib/action_controller/metal/renderers.rb:32:in
render_to_body' actionpack (4.1.6) lib/abstract_controller/rendering.rb:43:inrender_to_string' actionpack (4.1.6) lib/action_controller/metal/rendering.rb:21:in
render_to_string' wicked_pdf (0.11.0) lib/wicked_pdf/pdf_helper.rb:34:inrender_to_string_with_wicked_pdf' wicked_pdf (0.11.0) lib/wicked_pdf/pdf_helper.rb:61:in
make_pdf' wicked_pdf (0.11.0) lib/wicked_pdf/pdf_helper.rb:32:inrender_to_string_with_wicked_pdf' app/controllers/concerns/has_pdf_response.rb:15:in
respond_to_pdf' app/controllers/quotations_controller.rb:23:inblock (2 levels) in show' actionpack (4.1.6) lib/action_controller/metal/mime_responds.rb:258:in
call' actionpack (4.1.6) lib/action_controller/metal/mime_responds.rb:258:inrespond_to' app/controllers/quotations_controller.rb:20:in
show' actionpack (4.1.6) lib/action_controller/metal/implicit_render.rb:4:insend_action' actionpack (4.1.6) lib/abstract_controller/base.rb:189:in
process_action' actionpack (4.1.6) lib/action_controller/metal/rendering.rb:10:inprocess_action' actionpack (4.1.6) lib/abstract_controller/callbacks.rb:20:in
block in process_action' activesupport (4.1.6) lib/active_support/callbacks.rb:113:incall' activesupport (4.1.6) lib/active_support/callbacks.rb:113:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:166:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:166:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:149:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:149:inblock in halting_and_conditional' activesupport (4.1.6) lib/active_support/callbacks.rb:229:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:229:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:229:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:229:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:166:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:166:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:166:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:229:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:229:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:166:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:166:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:229:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:229:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:166:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:166:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:166:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:166:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:166:inblock in halting' activesupport (4.1.6) lib/active_support/callbacks.rb:86:in
call' activesupport (4.1.6) lib/active_support/callbacks.rb:86:inrun_callbacks' actionpack (4.1.6) lib/abstract_controller/callbacks.rb:19:in
process_action' actionpack (4.1.6) lib/action_controller/metal/rescue.rb:29:inprocess_action' actionpack (4.1.6) lib/action_controller/metal/instrumentation.rb:31:in
block in process_action' activesupport (4.1.6) lib/active_support/notifications.rb:159:inblock in instrument' activesupport (4.1.6) lib/active_support/notifications/instrumenter.rb:20:in
instrument' activesupport (4.1.6) lib/active_support/notifications.rb:159:ininstrument' actionpack (4.1.6) lib/action_controller/metal/instrumentation.rb:30:in
process_action' actionpack (4.1.6) lib/action_controller/metal/params_wrapper.rb:250:inprocess_action' activerecord (4.1.6) lib/active_record/railties/controller_runtime.rb:18:in
process_action' actionpack (4.1.6) lib/abstract_controller/base.rb:136:inprocess' actionview (4.1.6) lib/action_view/rendering.rb:30:in
process' actionpack (4.1.6) lib/action_controller/metal.rb:196:indispatch' actionpack (4.1.6) lib/action_controller/metal/rack_delegation.rb:13:in
dispatch' actionpack (4.1.6) lib/action_controller/metal.rb:232:inblock in action' actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:82:in
call' actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:82:indispatch' actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:50:in
call' actionpack (4.1.6) lib/action_dispatch/journey/router.rb:73:inblock in call' actionpack (4.1.6) lib/action_dispatch/journey/router.rb:59:in
each' actionpack (4.1.6) lib/action_dispatch/journey/router.rb:59:incall' actionpack (4.1.6) lib/action_dispatch/routing/route_set.rb:678:in
call' rack-pjax (0.8.0) lib/rack/pjax.rb:12:incall' warden (1.2.3) lib/warden/manager.rb:35:in
block in call' warden (1.2.3) lib/warden/manager.rb:34:incatch' warden (1.2.3) lib/warden/manager.rb:34:in
call' rack (1.5.2) lib/rack/etag.rb:23:incall' rack (1.5.2) lib/rack/conditionalget.rb:25:in
call' rack (1.5.2) lib/rack/head.rb:11:incall' remotipart (1.2.1) lib/remotipart/middleware.rb:27:in
call' actionpack (4.1.6) lib/action_dispatch/middleware/params_parser.rb:27:incall' actionpack (4.1.6) lib/action_dispatch/middleware/flash.rb:254:in
call' rack (1.5.2) lib/rack/session/abstract/id.rb:225:incontext' rack (1.5.2) lib/rack/session/abstract/id.rb:220:in
call' actionpack (4.1.6) lib/action_dispatch/middleware/cookies.rb:560:incall' activerecord (4.1.6) lib/active_record/query_cache.rb:36:in
call' activerecord (4.1.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:incall' actionpack (4.1.6) lib/action_dispatch/middleware/callbacks.rb:29:in
block in call' activesupport (4.1.6) lib/active_support/callbacks.rb:82:inrun_callbacks' actionpack (4.1.6) lib/action_dispatch/middleware/callbacks.rb:27:in
call' actionpack (4.1.6) lib/action_dispatch/middleware/reloader.rb:73:incall' actionpack (4.1.6) lib/action_dispatch/middleware/remote_ip.rb:76:in
call' actionpack (4.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:incall' actionpack (4.1.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in
call' railties (4.1.6) lib/rails/rack/logger.rb:38:incall_app' railties (4.1.6) lib/rails/rack/logger.rb:20:in
block in call' activesupport (4.1.6) lib/active_support/tagged_logging.rb:68:inblock in tagged' activesupport (4.1.6) lib/active_support/tagged_logging.rb:26:in
tagged' activesupport (4.1.6) lib/active_support/tagged_logging.rb:68:intagged' railties (4.1.6) lib/rails/rack/logger.rb:20:in
call' actionpack (4.1.6) lib/action_dispatch/middleware/request_id.rb:21:incall' rack (1.5.2) lib/rack/methodoverride.rb:21:in
call' rack (1.5.2) lib/rack/runtime.rb:17:incall' activesupport (4.1.6) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in
call' rack (1.5.2) lib/rack/lock.rb:17:incall' actionpack (4.1.6) lib/action_dispatch/middleware/static.rb:64:in
call' rack (1.5.2) lib/rack/sendfile.rb:112:incall' railties (4.1.6) lib/rails/engine.rb:514:in
call' railties (4.1.6) lib/rails/application.rb:144:incall' passenger (4.0.56) lib/phusion_passenger/rack/thread_handler_extension.rb:74:in
process_request' passenger (4.0.56) lib/phusion_passenger/request_handler/thread_handler.rb:141:inaccept_and_process_next_request' passenger (4.0.56) lib/phusion_passenger/request_handler/thread_handler.rb:109:in
main_loop' passenger (4.0.56) lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'
事实证明,当我调用时,我指向了我的图像的绝对路径 wicked_pdf_image_tag 该函数实际上指向 root_path.join('public', '图片')
解决方案是创建一个新方法或只使用此代码: image_tag "file://absolute_path_to_img_here",选项
[http://www.rubydoc.info/github/mileszs/wicked_pdf/WickedPdfHelper%3Awicked_pdf_image_tag][1]