Skip to content

Instantly share code, notes, and snippets.

@dlackty
Created October 3, 2016 18:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlackty/f07f40b67e0a043fccd11437e25bffd2 to your computer and use it in GitHub Desktop.
Save dlackty/f07f40b67e0a043fccd11437e25bffd2 to your computer and use it in GitHub Desktop.
Fixing for AWS SDK for Ruby under multi-threading environment
# config/initializers/aws-sdk.rb
require "aws-sdk"
# Threading in modern rails means the AWS autoloading can lead to partially
# loaded namespaces unless we eager load up front. But only do it when we're
# eager loading generally (in production).
Rails.application.config.before_eager_load do
Aws.eager_autoload!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment