Skip to content

Instantly share code, notes, and snippets.

@rainux
Forked from samgranieri/Gemfile
Created March 17, 2010 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rainux/335075 to your computer and use it in GitHub Desktop.
Save rainux/335075 to your computer and use it in GitHub Desktop.
How to get Rails 2.3.5 working with bundler 0.9.3
# this goes before Rails.boot!
class Rails::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 :default, Rails.env
old_load.bind(self).call
end
end
end
end
source :gemcutter
gem 'rails', '~> 2.3.5', :require => nil
begin
# Require the preresolved locked set of gems.
require File.expand_path('../../.bundle/environment', __FILE__)
rescue LoadError
# Fallback on doing the resolve at runtime.
require "rubygems"
require "bundler"
Bundler.setup
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment