title: Rails 4 pdfkit failed converting chartkick graph to pdf
body: <p>I am using Rails 4</p>
  
  <p>I followed instruction from <a href="https://github.com/pdfkit/pdfkit" rel="nofollow">https://github.com/pdfkit/pdfkit</a></p>
  
  <p>In controller I have</p>
  
  <pre><code>respond_to do |format|
                      format.html {render layout:'application'}
                      format.csv {send_data @testdatares.to_csv}
                      format.pdf {
                              html = render_to_string(:layout =&gt; 'application' , :action =&gt; "testpage.html.erb");
                              kit = PDFKit.new(html);
                              kit.stylesheets &lt;&lt; "#{Rails.root}/app/assets/stylesheets/application.css";
                              send_data(kit.to_pdf, :filename =&gt; "some_name.pdf", :type =&gt; 'application/pdf')
                      }
              end
  </code></pre>
  
  <p>In application.html.erb I have</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;          
  &lt;head&gt;                  
  &lt;title&gt;STNEW&lt;/title&gt;
  &lt;%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' =&gt; true %&gt;
  &lt;%= javascript_include_tag 'application', 'data-turbolinks-track' =&gt; true %&gt;
  &lt;%= javascript_include_tag "http://www.google.com/jsapi", "/usr/local/lib/ruby/gems/2.1.0/gems/chartkick-1.3.2/app/assets/javascripts/chartkick",media:'all' %&gt;
  &lt;%= csrf_meta_tags %&gt;
  &lt;/head&gt;       
  </code></pre>
  
  <p>Please note that I already used absolute path to chartkick.js</p>
  
  <p>Now in html the chartkick contents were perfectly displayed.</p>
  
  <p>But in the pdf file generated by pdfkit all chartkick contents were shown as "loading", while text was correctly shown</p>
  
  <p>Googled around but found no answer</p>