Carrierwave Conflict?
curtp opened this issue · comments
We're using Carrierwave (0.11.x) and premailer-rails (1.10.2) and think we've identified an issue with these two gems running in the same code base.
In the development environment, Carrierwave is setup to use the local file system. When pulling the image_url for an image, it is supposed to return the file system path to the image. After we installed premailer-rails and inky-rb, Carrierwave is now returning an URL instead of a file system path.
I switched to a branch which didn't have the premailer-rails and inky-rb gem, and Carrierwave behaves as expected.
We're using the default configuration for premailer-rails. Here is the code we're using to get the path to the image:
# Model
class Pic < ApplicationRecord
mount_uploader :image, PicUploader
end
# In the rails console
pic = Pic.first
# Without premailer-rails:
pic.image.url
"/pics/2/imageedit_3_9222895510_s300.png"
# With premailer-rails:
pic.image.url
"http://localhost:3000/pics/2/imageedit_3_9222895510_s300.png"
I'm almost certain that this is not caused by premailer-rails as it doesn't do any monkey patching. Please provide a minimal working example, otherwise it's hard to look into this.
Ok, I've been trying to track down what changed that could have caused this issue. This and the inky-rb were the last changes. I'll keep digging and will provide a minimal working copy if I'm not able to make any progress elsewhere.
Thanks for replying!
You can close this. I was able to find a location to put a workaround in so no more conflict in our code base.