I have troubles with wicked_pdf on production server. I have such code here in _results.pdf.haml:
#container
= wicked_pdf_javascript_include_tag "pdf_application"
:javascript
$(document).ready(function(){drawPDFCharts(#{generate_javascript_for_pdf_generator(@poll.answer_count_per_question)}, "container")});
here is pdf_application.js
//= require jquery
//= require highcharts
//= require poll-pdf-chart-generation.js.coffee
On local machine and staging everithing just fine, but on production there is an error:
Started GET "/121-consumer-electronics.pdf" for 94.76.74.170 at 2013-01-16 13:52:53 +0000
Processing by PollsController#show as PDF
Parameters: {"id"=>"121-consumer-electronics"}
***************WICKED***************
Rendered polls/_results.pdf.haml (145.7ms)
Completed 500 Internal Server Error in 816ms
ActionView::Template::Error (pdf_application.js isn't precompiled):
8:
9: #container
10:
11: = wicked_pdf_javascript_include_tag "pdf_application"
12: :javascript
13: $(document).ready(function(){drawPDFCharts(#{generate_javascript_for_pdf_generator(@poll.answer_count_per_question)}, "container")});
Here is my production.rb:
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = true
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
I cant figure out how to make it work, I saw some similar questions here, And I tried to add this file to precompile array and restart the server, but it didnt help. As I get I have compiling assets on local machine, and no compiling on production, and somehow this file is not precompiled when I try to run it...