I solve this issue by putting these configuration in the block in config/environments/staging.rb
Demo::Application.configure do
config.action_controller.asset_host = Proc.new { |source|
if source.include?('/assets')
"d1xw0c7m8has5k.cloudfront.net"
else
"#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com"
end
}
config.action_mailer.asset_host = Proc.new { |source|
if source.include?('/assets')
"http://d1xw0c7m8has5k.cloudfront.net"
else
"http://#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com"
end
}
end
and it is necessary to provide protocol with action_mailer asset_host, i.e 'HTTP'