嘗試配置carrierwave上傳時,出現此錯誤,它顯示configuration.rb第73行,該文件甚至不存在?或者我無法找到它。Carrierwave:`eval':不隱式將nil轉換爲String(TypeError)
/Users/spencerlong/.rvm/gems/ruby-2.0.0-p451/gems/carrierwave-0.10.0/lib/carrierwave/uploader/configuration.rb:73:in `eval': no implicit conversion of nil into String (TypeError)
carrierwave.rb
CarrierWave.configure do |config|
config.storage = :aws
config.aws_bucket = 'larfs'
config.aws_acl = :public_read
config.asset_host = ''
config.aws_authenticated_url_expiration = 60 * 6 * 24 * 365
config.aws_credentials = {
access_key_id: "ABCABC",
secret_access_key: "ABCABC"
}
end
image_uploader.rb
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
storage :aws
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
version :thumb do
process :resize_to_fit => [50, 50]
end
def extension_white_list
%w(jpg jpeg gif png)
end
end