Rails 4 pdfkit failed converting chartkick graph to pdf
I am using Rails 4 I followed instruction from https://github.com/pdfkit/pdfkit In controller I have respond_to do |format| format.html {render layout:'application'} format.csv {send_data @testdatares.to_csv} format.pdf { html = render_to_string(:layout => 'application' , :action => "testpage.html.erb"); kit = PDFKit.new(html); kit.stylesheets << "#{Rails.root}/app/assets/stylesheets/application.css"; send_data(kit.to_pdf, :filename => "some_name.pdf", :type => 'application/pdf') } end In application.html.erb I have <!DOCTYPE html> <html> <head> <title>STNEW</title> <%= stylesheet_link_tag