I'm have trouble uploading my assets to S3 with asset_sync
production.rb
config.action_controller.asset_host = "//#{ENV['FOG_DIRECTORY']}.s3-eu-west-1.amazonaws.com"
config.assets.digest = true
config.assets.enabled = true
config.assets.initialize_on_precompile = true
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']
config.fog_directory = ENV['FOG_DIRECTORY']
config.fog_region = 'eu-west-1'
end
end
heroku config
AWS_ACCESS_KEY_ID: XXX
AWS_SECRET_ACCESS_KEY: XXX
FOG_DIRECTORY: bucket_name
FOG_PROVIDER: AWS
FOG_REGION: 'eu-west-1'
$export
declare -x AWS_ACCESS_KEY_ID= XXX
declare -x AWS_SECRET_ACCESS_KEY= XXX
declare -x FOG_DIRECTORY="bucket_name"
declare -x FOG_PROVIDER="AWS"
http://blog.firmhouse.com/complete-guide-to-serving-your-rails-assets-over-s3-with-asset_sync
ones push on heroku assets points to //bucket_name.s3-eu-west-1.amazonaws.com/assets/icons/name_xxxxxxxxxx.png
and when running $rake assets:precompile
the files dose not get uploaded to S3 and gets only precompile locally. Any idea ? Thanks a lot.
EDIT:
I've just changed the Gemfile from :
group :assets do
gem 'asset_sync'
end
to the global gems
gem 'asset_sync'
and now I having warning message [WARNING] fog: followed redirect to bucket_name.s3-external-3.amazonaws.com, connecting to the matching region will be more performant
I think I can figure this out, but only the css files gets uploaded.not the js file and images.