2
我asset_sync寶石不會上傳到S3的時候我預編譯的資產Heroku的asset_sync寶石不上傳到S3
asset_sync.rb
if defined?(AssetSync)
AssetSync.configure do |config|
config.fog_provider = 'AWS'
config.aws_access_key_id = ENV['AWS_ACCESS_KEY_ID']
config.aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
# To use AWS reduced redundancy storage.
# config.aws_reduced_redundancy = true
config.fog_directory = ENV['FOG_DIRECTORY']
# Invalidate a file on a cdn after uploading files
# config.cdn_distribution_id = "12345"
# config.invalidate = ['file1.js']
# Increase upload performance by configuring your region
config.fog_region = 'ap-southeast-2'
#
# Don't delete files from the store
# config.existing_remote_files = "keep"
#
# Automatically replace files with their equivalent gzip compressed version
# config.gzip_compression = true
#
# Use the Rails generated 'manifest.yml' file to produce the list of files to
# upload instead of searching the assets directory.
# config.manifest = true
#
# Fail silently. Useful for environments such as Heroku
# config.fail_silently = true
end
end
production.rb
config.assets.enabled = true
config.assets.digest = true
config.action_controller.asset_host = "//#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com"
config.assets.initialize_on_precompile = true
application.rb
config.assets.enabled = true
config.assets.digest = true
當我預編譯時,我甚至沒有收到任何消息顯示它正在上傳。
這是發生這種情況的原因嗎?
你設法解決這個問題呢?我現在遇到了同樣的問題 – Dave
有一些有效的用例,但作爲更新,heroku強烈反對這種方法:https://devcenter.heroku.com/articles/please-do-not-use-asset-sync – Ricky