gpt4 book ai didi

ruby-on-rails - Heroku asset_sync gem 没有上传到 s3

转载 作者:太空宇宙 更新时间:2023-11-03 16:27:59 24 4
gpt4 key购买 nike

当我预编译 Assets 时,我的 asset_sync gem 没有上传到 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

当我预编译时,我什至没有收到任何消息表明它正在上传。

发生这种情况是否有原因?

最佳答案

可能你有:

group :assets do
gem 'asset_sync'
end

你应该把那颗 gem 从那个组里拿出来

关于ruby-on-rails - Heroku asset_sync gem 没有上传到 s3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21337097/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com