Skip to content

Instantly share code, notes, and snippets.

@jondkinney
Created July 9, 2013 21:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jondkinney/5961489 to your computer and use it in GitHub Desktop.
# config/initializers/pdfkit.rb
PDFKit.configure do |config|
if Rails.env.development?
config.wkhtmltopdf = '/usr/local/bin/wkhtmltopdf'
config.root_url = "http://bolstr.dev" # Use only if your external hostname is unavailable on the server.
elsif Rails.env.test?
config.root_url = "http://bolstr.dev"
if ENV['CI'] == "true"
config.wkhtmltopdf = '/home/ubuntu/bin/wkhtmltopdf'
else
config.wkhtmltopdf = '/usr/local/bin/wkhtmltopdf'
end
else
# this is where it's installed on the server
config.wkhtmltopdf = '/opt/wkhtmltopdf/bin/wkhtmltopdf'
end
# config.default_options = {
# page_size: 'Legal',
# print_media_type: true
# }
# config.root_url = "http://localhost" # Use only if your external hostname is unavailable on the server.
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment