Skip to content

Instantly share code, notes, and snippets.

@hone
Created January 16, 2010 18:12
Show Gist options
  • Select an option

  • Save hone/278933 to your computer and use it in GitHub Desktop.

Select an option

Save hone/278933 to your computer and use it in GitHub Desktop.
class Boot
def run
load_initializer
extend_environment
Rails::Initializer.run(:set_load_path)
end
def extend_environment
Rails::Initializer.class_eval do
old_load = instance_method(:load_environment)
define_method(:load_environment) do
Bundler.require_env RAILS_ENV
old_load.bind(self).call
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment