简体   繁体   English

Ruby on Rails:PDF.JS ActionController :: RoutingError(没有路由与[GET]“ / pdf js / web / viewer.html”匹配):

[英]Ruby on Rails: PDF.JS ActionController::RoutingError (No route matches [GET] “/pdf js/web/viewer.html”):

I'm using PDF.js in a rails application from https://github.com/shyammohankanojia/pdfjs_rails . 我正在https://github.com/shyammohankanojia/pdfjs_rails的Rails应用程序中使用PDF.js。 I followed the instructions and everything works fine in development, but in production the viewer doesn't show the pdf. 我遵循了说明,开发中一切正常,但是在生产中,查看器没有显示pdf。

I got the following error: "ActionController::RoutingError (No route matches [GET] "/pdf js/web/viewer.html"):". 我收到以下错误:“ ActionController :: RoutingError(没有与[GET]匹配的路由“ / pdf js / web / viewer.html”):”。

I'm sure that pdf's are uploaded correctly in production. 我确定pdf可以在生产中正确上传。 I ran bundle install and precompiled assets again. 我再次运行捆绑安装和预编译资产。 In development I didn't have to make any changes to routes.rb. 在开发中,我不必对route.rb进行任何更改。

Any thoughts on how can i get the viewer to show the pdf in production? 关于如何让查看者在生产中显示pdf的任何想法?

thanks for your help, i found that changing this line in production.rb "config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?" 感谢您的帮助,我发现在production.rb中更改此行“ config.serve_static_files = ENV ['RAILS_SERVE_STATIC_FILES']。present?” for this one "config.serve_static_files = true" will do the trick 为此,“ config.serve_static_files = true”将达到目的

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 pdf.js 和 viewer.html 默认缩放初始值 - pdf.js and viewer.html Default zoom initial value PDF.js如果不在Viewer.html的同一文件夹中,则不会打开PDF文件 - PDF.js not opening PDF file if it is not in the same folder of viewer.html PDF.js:使用 postMessage 将 base64 传递给 iframe 中的 viewer.html - PDF.js: using postMessage to pass base64 to viewer.html in iframe 如何使用pdf.js从外部查看器(viewer.html)中打开服务器的base64字符串响应? - how to open base64 String response from server in external viewer (viewer.html) using pdf.js? ActionController :: RoutingError(没有路由与[GET]“ / javascripts / application.js”匹配) - ActionController::RoutingError (No route matches [GET] “/javascripts/application.js”) 烧瓶和pdf查看器(pdf.js) - Flask and pdf viewer (pdf.js) 如何从另一个Rails项目中调用JavaScript文件? ActionController :: RoutingError(没有路由与[GET]“ / assets / trackmetrics.js”匹配) - How do call a javascript file from another Rails project? ActionController::RoutingError (No route matches [GET] “/assets/trackmetrics.js”) 服务器上的Rails 6收到很多“ ActionController :: RoutingError:没有路由匹配[GET] /31194a065aebf1674b61.worker.js”的请求 - Rails 6 on server getting a lot of “ActionController::RoutingError: No route matches [GET] /31194a065aebf1674b61.worker.js” requests ActionController :: RoutingError(没有路由匹配[GET]“/members/js/bootstrap.min.js"):(Missing资产文件) - ActionController::RoutingError (No route matches [GET] “/members/js/bootstrap.min.js”):(Missing Asset files) ActionController :: RoutingError(没有路由与[GET] controller_name / fusioncharts.widgets.js匹配 - ActionController::RoutingError (No route matches [GET] controller_name/fusioncharts.widgets.js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM