Skip to content
Dominic Sayers edited this page May 6, 2016 · 18 revisions

This is a list of known issues in CarrierWave. If you have the time and ability to help come up with a better solution for these issues, your contributions would be most welcome!

Updating from 0.11.0 to 0.11.1 and vCard (.vcf) files

Prior to v0.11.1 you may have seen the content-type of files with a .vcf extension being returned as text/x-vcard. This mime type is now deprecated. As of v0.11.1 this will now be returned as the correct mime type text/vcard.

For more information see RFC 6350

recreate_versions! and unique random filenames

When you generate unique filenames for your uploaded files you have to call save! on your model after recreate_versions!. Otherwise your database and file system are running out of sync because recreate_versions! doesn't save the new filename to the database. You can read more about this behaviour in this issue and stackoverflow answer.

Edge case problems when not using the mount_on option in mounted uploaders

As discussed in issue 249 and elsewhere, you may encounter problems when not using the mount_on option in a mounted uploader. Due to bug/feature/unexpected behavior in ActiveRecord, when loading records from database using associations it might happen that ActiveRecord tries to assign String value to uploader column. If this happens you need to rename database column (for example use file_identifier instead of file) and specify new name as mount_on option when mounting uploader.

Install image manipulation libraries first, and then install their associated gems

If you get an error such as "Attachment failed to be processed" ensure that you have installed the relevant image manipulation library before installing the associated gem.

Cannot convert multipage PDFs to JPG with RMagick

See issue 517 for details.

Ruby 1.9 & ImageMagick

Read this Stack Overflow page and try uninstalling any prexisting installations and deleting your cache.

brew remove imagemagick
brew --cache imagemagick
brew install -f imagemagick --disable-openmp

ActiveRecord callback ordering

# If we have this model
class MyModel < ActiveRecord::Base
  mount_uploader :bam, BamUploader
  ...
  before_save :set_bam
  ...
  def set_bam
    self.bam = File.open("bam")
  end
end

# Then play
m = MyModel.new
m.save

# Result
m.bam # => nil

CarrierWave is doing part of its magic on before_save and our callback is executed after CarrierWave's because its declared later.

There are 3 workarounds:

  • We do our business on after_validation
  • We declare the before_save callback before calling mount_uploader
  • Or we prepend our before_save with before_save :set_bam, :prepend => true

Fog and Dots in Bucket Names

To avoid having issues with SSL certificate errors when trying to display images on a webpage, do not use dots in bucket names. An example of a bad bucket name would be "my.s3.bucket", which would result in a url like "https://my.s3.bucket.s3-website-us-east-1.amazonaws.com". This address would result in an invalid certificate error because Amazon's certificate is only valid for *.s3-website-us-east-1.amazonaws.com. So any bucket name with extra dots will not be valid. See issue Issue 531 for more details.

Clone this wiki locally