Skip to content

Instantly share code, notes, and snippets.

@agibralter
Created November 18, 2009 21:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save agibralter/238294 to your computer and use it in GitHub Desktop.
require "#{File.dirname(__FILE__)}/../vendor/bundler_gems/environment"
module Rails
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_gems)
define_method(:load_gems) do
old_load.bind(self).call
Bundler.require_env RAILS_ENV
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment