Dokku의 Digital Ocean에서 Rails 4 응용 프로그램을 실행 중입니다. 사용자는 클립으로 이미지를 업로드 할 수 있습니다. 이미지를 잘 업로드 할 수 있으며 애플리케이션이 훌륭하게 실행되고 모든 이미지가 표시됩니다.Rails - Dokku - 클립 : 제작 중단 (404 초) 사용자 업로드 이미지
class ProductImage < ActiveRecord::Base
has_attached_file :image, default_url: "/images/:style/missing.png",
:path =>":rails_root/public/system/:attachment/:id/:basename_:style.:extension",
:url =>"/system/:attachment/:id/:basename_:style.:extension",
styles: { thumb: ["64x64#", :jpg], medium: ['200x200>', :jpg],
large: ['400x400>', :jpg] }
validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
belongs_to :product
end
나는 rails_12factor 보석이 : 나는 텍스트 변경과 같은 작은 변화를 만들어 나가 $ 자식 푸시 dokku 마스터를 실행하면, 모든 이미지
모델 (404)을 업로드했습니다.
Rails.application.configure do
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
config.assets.js_compressor = :uglifier
config.assets.compile = true
config.assets.digest = true
config.log_level = :debug
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.log_formatter = ::Logger::Formatter.new
config.active_record.dump_schema_after_migration = false
end
어떤 도움이 크게 감사합니다 다음은 설정 파일입니다!
dokku 고정 표시기 - 옵션 : APP_NAME의 배포 추가 "-v/홈/dokku/FOLDER_NAME를 :/응용 프로그램/공공/업로드" 내가 .... 이렇게 늦게 돌아 가지 미안 실종 있었는지 이잖아. –
멋지다면 답을 수락하면 도움이됩니다. – xploshioOn