-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
I am using rails api 5.2.1 and ruby 2.5.1.
My rails api application has model Location with map field which is image (carrierwave).
My goal is to make print screen of google static map and upload it to claudinary. Right not everything works fine on local. It takes print screen and upload it to claudinary storage, but when I deploy app on heroku its just make white print screen board image send it to claudinary.
My code
// config/initializers/imgkit.rb
IMGKit.configure do |config|
config.wkhtmltoimage = Rails.root.join('bin', 'wkhtmltoimage-amd64').to_s if ENV['RACK_ENV'] == 'production'
end
// models/location.rb
def take_google_map_photo
url = GoogleMap.generate_static_map_path(self)
file = Tempfile.new(["location-#{id}-", '.jpg'], Rails.root.join('tmp'),
encoding: 'ascii-8bit')
file.write(IMGKit.new(url,
'no-stop-slow-scripts': true,
'javascript-delay': 15000,
'load-error-handling': 'skip', height: 670).to_jpg)
file.flush
self.map = file
save!
end
I am getting image like this
Does somebody know how to fix this issue with HEROKU and IMGKit
bcarradini
Metadata
Metadata
Assignees
Labels
No labels