Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Bundler

  • Loading branch information...
commit e94b607b3d9843085c178057702199a819d3725a 1 parent a0f0078
Edward Anderson authored February 27, 2012
10  Gemfile
... ...
@@ -0,0 +1,10 @@
  1
+source :rubygems
  2
+
  3
+gem 'rails', '2.3.14'
  4
+gem 'rubytree', :require => 'tree'
  5
+gem 'coderay', '~> 1.0.0'
  6
+gem 'pg'
  7
+
  8
+group :development do
  9
+  gem 'mongrel'
  10
+end
15  config/boot.rb
@@ -115,5 +115,20 @@ def read_environment_rb
115 115
   end
116 116
 end
117 117
 
  118
+# Bundler
  119
+class Rails::Boot
  120
+  def run
  121
+    load_initializer
  122
+
  123
+    Rails::Initializer.class_eval do
  124
+      def load_gems
  125
+        @bundler_loaded ||= Bundler.require :default, Rails.env
  126
+      end
  127
+    end
  128
+
  129
+    Rails::Initializer.run(:set_load_path)
  130
+  end
  131
+end
  132
+
118 133
 # All that for this:
119 134
 Rails.boot!
4  config/environment.rb
@@ -55,8 +55,8 @@
55 55
   # It will automatically turn deliveries on
56 56
   config.action_mailer.perform_deliveries = false
57 57
 
58  
-  config.gem 'rubytree', :lib => 'tree'
59  
-  config.gem 'coderay', :version => '~>1.0.0'
  58
+  # config.gem 'rubytree', :lib => 'tree'
  59
+  # config.gem 'coderay', :version => '~>1.0.0'
60 60
 
61 61
   # Load any local configuration that is kept out of source control
62 62
   # (e.g. gems, patches).
20  config/preinitializer.rb
... ...
@@ -0,0 +1,20 @@
  1
+begin
  2
+  require "rubygems"
  3
+  require "bundler"
  4
+rescue LoadError
  5
+  raise "Could not load the bundler gem. Install it with `gem install bundler`."
  6
+end
  7
+
  8
+if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
  9
+  raise RuntimeError, "Your bundler version is too old for Rails 2.3." +
  10
+   "Run `gem install bundler` to upgrade."
  11
+end
  12
+
  13
+begin
  14
+  # Set up load paths for all bundled gems
  15
+  ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
  16
+  Bundler.setup
  17
+rescue Bundler::GemNotFound
  18
+  raise RuntimeError, "Bundler couldn't find some gems." +
  19
+    "Did you run `bundle install`?"
  20
+end

0 notes on commit e94b607

Please sign in to comment.
Something went wrong with that request. Please try again.