Skip to content

Commit 44531ea

Browse files
committed
Upgrade for changes in Bundler 0.9.x series
* see also http://gist.github.com/302406. Signed-off-by: Alex Coles <[email protected]>
1 parent 330c9b8 commit 44531ea

File tree

4 files changed

+73
-24
lines changed

4 files changed

+73
-24
lines changed

Gemfile

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
clear_sources
2-
bundle_path 'vendor/bundler_gems'
1+
source :gemcutter
32

4-
source 'http://gemcutter.org'
5-
source 'http://gems.github.com'
6-
7-
gem 'rails', '2.3.5'
3+
gem 'rails', '2.3.5', :require => nil
84
gem 'ferret', '0.11.6'
95
gem 'will_paginate', '2.3.11'
106
gem 'ruby-recaptcha', '1.0.0'
117
gem 'newrelic_rpm'
128

13-
only :test do
9+
group :test do
1410
gem 'rspec', '1.2.9'
1511
gem 'rspec-rails', '1.2.9'
1612
end

Gemfile.lock

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
dependencies:
3+
- rails: = 2.3.5
4+
- ferret: = 0.11.6
5+
- will_paginate: = 2.3.11
6+
- ruby-recaptcha: = 1.0.0
7+
- newrelic_rpm: ">= 0"
8+
- rspec: = 1.2.9
9+
- rspec-rails: = 1.2.9
10+
specs:
11+
- activesupport:
12+
version: 2.3.5
13+
- actionmailer:
14+
version: 2.3.5
15+
- will_paginate:
16+
version: 2.3.11
17+
- rack:
18+
version: 1.0.1
19+
- actionpack:
20+
version: 2.3.5
21+
- rspec:
22+
version: 1.2.9
23+
- rspec-rails:
24+
version: 1.2.9
25+
- newrelic_rpm:
26+
version: 2.9.9
27+
- rake:
28+
version: 0.8.7
29+
- ferret:
30+
version: 0.11.6
31+
- activerecord:
32+
version: 2.3.5
33+
- activeresource:
34+
version: 2.3.5
35+
- rails:
36+
version: 2.3.5
37+
- ruby-recaptcha:
38+
version: 1.0.0
39+
hash: c2397dcbd396cedcf5ecd4d51527d76c691b4a1d
40+
sources:
41+
- Rubygems:
42+
uri: http://gemcutter.org

config/boot.rb

+18
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,23 @@ def read_environment_rb
106106
end
107107
end
108108

109+
class Rails::Boot
110+
def run
111+
load_initializer
112+
extend_environment
113+
Rails::Initializer.run(:set_load_path)
114+
end
115+
116+
def extend_environment
117+
Rails::Initializer.class_eval do
118+
old_load = instance_method(:load_environment)
119+
define_method(:load_environment) do
120+
Bundler.require :default, Rails.env
121+
old_load.bind(self).call
122+
end
123+
end
124+
end
125+
end
126+
109127
# All that for this:
110128
Rails.boot!

config/preinitializer.rb

+10-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
require "#{File.dirname(__FILE__)}/../vendor/bundler_gems/environment"
1+
begin
2+
# Require the preresolved locked set of gems.
3+
require File.expand_path('../../.bundle/environment', __FILE__)
4+
rescue LoadError
5+
raise RuntimeError, "You have not locked your bundle. Run `bundle lock`."
26

3-
class Rails::Boot
4-
def run
5-
load_initializer
6-
extend_environment
7-
Rails::Initializer.run(:set_load_path)
8-
end
9-
10-
def extend_environment
11-
Rails::Initializer.class_eval do
12-
old_load = instance_method(:load_environment)
13-
define_method(:load_environment) do
14-
Bundler.require_env RAILS_ENV
15-
old_load.bind(self).call
16-
end
17-
end
18-
end
7+
# Fallback on doing the resolve at runtime.
8+
# This does not work with rails 2.3.5 as of bundler 0.9.5.
9+
require "rubygems"
10+
require "bundler"
11+
Bundler.setup
1912
end

0 commit comments

Comments
 (0)