Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capistrano - Carrierwave LoadError: cannot load such file -- carrierwave/processing/mime_types

When I run cap production deploy I keep running into this error with carrier wave. I have posted my carrierwave settings below.

Tasks: TOP => deploy:assets:precompile
The deploy has failed with an error: Exception while executing as [email protected]: rake exit status: 1
rake stdout: Nothing written
rake stderr: rake aborted!
LoadError: cannot load such file -- carrierwave/processing/mime_types
 /home/deploy/aldrinclement/shared/bundle/ruby/2.3.0/gems/activesupport-         4.2.6/lib/active_support/dependencies.rb:274:in `require'
 /home/deploy/aldrinclement/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
 /home/deploy/aldrinclement/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
 /home/deploy/aldrinclement/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
 /home/deploy/aldrinclement/releases/20170103201423/app/uploaders/author_image_uploader.rb:1:in `<top (required)>'

Carrierwave.rb

if Rails.env.production? || Rails.env.staging?
  CarrierWave.configure do |config|
    config.fog_credentials = {
        provider:                   'AWS',
        aws_access_key_id:         Rails.application.secrets.AWS_ACCESS_KEY_ID,
        aws_secret_access_key:     Rails.application.secrets.AWS_SECRET_ACCESS_KEY,
        region:                    Settings.aws_region
    }
    config.fog_directory = Settings.aws_s3_bucket_name
    config.permissions = 0666
    config.directory_permissions = 0777
    config.storage = :fog
  end
end

CarrierWave::SanitizedFile.sanitize_regexp = /[^[:word:]\.\-\+]/

My secrets.yml has the AWS keys defined - I had run into missing aws keys and solved that issue with secrets.yml symlinked in my deploy.rb file. I'm using carrierwave 1.0.0 in my Gemfile.

like image 326
cleme001 Avatar asked Dec 24 '22 22:12

cleme001


1 Answers

mime_types file has been removed from carrierwave, see commit.

You do likely have require 'carrierwave/processing/mime_types' on the top of app/uploaders/author_image_uploader.rb. You need to either remove carrierwave mime_types references from the project and switch to mime-types gem which is a runtime dependency of carrierwave now or rollback to the previous carrierwave version.

like image 103
Slava.K Avatar answered Feb 09 '23 01:02

Slava.K