First of all, everything works just fine in my dev environment and worked fine in production until I updated my Rails app to Rails 5.2.2 and Ruby to 2.5.3 (both were only a couple of minor versions off). I updated a number of other gems but neither the wicked pdf or wkhtmltopdf-binary were updated. I'm unsure about their dependencies. On production (using Heroku) wicked_pdf
is not rendering images from outside of my domain.
Here are the gems I am using:
gem 'wicked_pdf' #version 1.1.0
gem 'wkhtmltopdf-binary' #version 0.12.4
The following code works in development but not in production:
<%= image_tag @invoice.job.customer.account.logo.url, width: 220 %>
<%= image_tag @invoice.job.customer.account.logo_url, width: 220 %>
<%= wicked_pdf_image_tag @invoice.job.customer.account.logo_url, width: 220 %>
<img src="<%= @invoice.job.customer.account.logo_url %>" width="220">
Displaying a local image works on production:
<%= image_tag "logo.png" width: 220 %>
I assume this has something to do with Heroku because I've read about problems with wkhtmltopdf-binary and Heroku but have had no luck from the attempts I've made.