【发布时间】:2021-12-12 16:48:23
【问题描述】:
我正在尝试根据环境将 slate 文档推送到 2 个不同的 S3 存储桶。 但它抱怨 s3_sync 不是中间人的参数。
我已经使用 config.rb 提到了环境中的 S3 存储桶,但是当我运行 bundle exec middleman s3_sync --verbose --environment=internal 时仍然遇到上述问题
config.rb:
configure :internal do
s3_sync.bucket = ENV['INTERNAL_DOCS_AWS_BUCKET'] # The name of the internal docs S3 bucket you are targeting. This is globally unique.
end
activate :s3_sync do |s3_sync|
s3_sync.bucket = ENV['DOCS_AWS_BUCKET'] # The name of the S3 bucket you are targeting. This is globally unique.
s3_sync.region = ENV['DOCS_AWS_REGION'] # The AWS region for your bucket.
s3_sync.aws_access_key_id = ENV['DOCS_AWS_ACCESS_KEY_ID']
s3_sync.aws_secret_access_key = ENV['DOCS_AWS_SECRET_ACCESS_KEY']
s3_sync.prefer_gzip = true
s3_sync.path_style = true
s3_sync.reduced_redundancy_storage = false
s3_sync.acl = 'public-read'
s3_sync.encryption = false
s3_sync.prefix = ''
s3_sync.version_bucket = false
s3_sync.index_document = 'index.html'
s3_sync.error_document = '404.html'
end
错误:
捆绑器:加载失败命令:中间人 (/usr/local/bundle/bin/middleman) NameError: undefined local variable 或 #Middleman::ConfigContext:0x0000561eca099a40 的方法 `s3_sync'
【问题讨论】:
标签: ruby amazon-s3 bundler middleman