jnicklas/carrierwave — Issue #647: Keep getting error "TypeError (can't convert nil into String)"
Author: dickyblue
Created: 2012-03-07 07:37:13+00:00
State: open

Hi. I am using fog 0.9.0, carrierwave 0.5.8, ruby 1.9.3p0, and rails 3.2. I keep getting this error no matter what I do. I've been mulling over it for a few days now and tried everything on the web and I can't seem to fix it. Thanks.

#carrierwave.rb

CarrierWave.configure do |config|
config.fog_credentials = {
provider: 'AWS',
aws_access_key_id: ENV['code'],
aws_secret_access_key: ENV['secret_code'],
provider: 'AWS'
}

if Rails.env.test? || Rails.env.cucumber?
config.storage = :file
config.enable_processing = false
config.root = "#{Rails.root}/tmp"
else
config.storage = :fog
end

config.cache_dir = "#{Rails.root}/tmp/uploads"
config.fog_directory = ENV['bucket']
config.fog_public = true
end

#uploader

class GiftImageUploader < CarrierWave::Uploader::Base

include CarrierWave::RMagick

def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end

version :thumb do
process :resize_to_limit => [170, 170]
end
end