我尝试使用类似Github上的示例的旧应用程序,但现在它不起作用.
完整追踪:here
的Gemfile
source 'https://rubygems.org'gem 'rails','3.2.2'gem 'mini_magick','~> 3.4'gem 'carrIErwave','~> 0.5.8'gem 'fog'gem 'activeadmin','~> 0.4.3'gem 'httparty'gem 'dalli'gem 'Json'gem "mercury-rails",:git => "https://github.com/jejacks0n/mercury.git"gem 'newrelic_rpm'group :assets do gem 'sass-rails','~> 3.2.4' gem 'coffee-rails','~> 3.2.2' gem 'uglifIEr','>= 1.0.3'endgem 'jquery-rails'gem 'jquery_datepicker'group :development do gem 'sqlite3'endgroup :production do gem 'pg'end
这是carrIErwave配置:
# config/carrIErwave.rb# enCoding: utf-8require 'carrIErwave'CarrIErWave.configure do |config| config.fog_credentials = { :provIDer => 'AWS',# required :aws_access_key_ID => 'ACCESS_KEY',# required :aws_secret_access_key => 'SECRET_KEY',# required :region => 'eu-west-1' # optional,defaults to 'us-east-1' } config.fog_directory = 'lkrails' # required config.fog_host = 'https://lkrails.s3-eu-west-1.amazonaws.com' config.fog_public = true # optional,defaults to true config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional,defaults to {} # Make the tmp dir work on Heroku # config.cache_dir = "#{Rails.root}/tmp/uploads"end
这是上传者
# uploaders/images_uploader.rbclass Imagesuploader < CarrIErWave::Uploader::Base include CarrIErWave::MiniMagick storage :fog def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.ID}" end version :tiny do process :resize_to_limit => [25,25] end version :thumb do process :resize_to_limit => [50,50] end version :medium do process :resize_to_limit => [120,120] end def extension_white_List %w(jpg jpeg gif png) end def filename if original_filename @name ||= Digest::MD5.hexdigest(file.dirname(current_path)) "#{@name}.#{file.extension}" endend解决方法 根据您的日志文件,您的雾版本非常老.您使用的是0.3.25,最新的标签是1.1.2.试着这样做:
bundle update fog
您的版本的carrIErwave也同样过时了,所以我也捆绑了更新的carrIErwave.这应该有助于纠正这个问题.
总结以上是内存溢出为你收集整理的ruby-on-rails – CarrierWave无法使用Fog和S3:ArgumentError …“不是公认的存储提供程序”全部内容,希望文章能够帮你解决ruby-on-rails – CarrierWave无法使用Fog和S3:ArgumentError …“不是公认的存储提供程序”所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)