public
Created

How to get Rails 2.3.5 working with bundler 0.9.3

  • Download Gist
Gemfile
Ruby
1 2
source :gemcutter
gem 'rails', '~> 2.3.5', :require => nil
boot.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# 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
preinitializer.rb
Ruby
1 2 3 4 5 6 7 8 9
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.