diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/boot.rb | 7 | ||||
-rw-r--r-- | config/environment.rb | 14 | ||||
-rw-r--r-- | config/preinitializer.rb | 20 |
3 files changed, 27 insertions, 14 deletions
diff --git a/config/boot.rb b/config/boot.rb index 0f5e661ed..943029408 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -46,6 +46,13 @@ module Rails class Boot def run load_initializer + + Rails::Initializer.class_eval do + def load_gems + @bundler_loaded ||= Bundler.require :default, Rails.env + end + end + Rails::Initializer.run(:set_load_path) end end diff --git a/config/environment.rb b/config/environment.rb index f2164f1c8..7b6e8f5bc 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -17,12 +17,8 @@ $:.push(File.join(File.dirname(__FILE__), '../commonlib/rblib')) # (type "git submodule update --init" in the whatdotheyknow directory) # ruby-ole and ruby-msg. We use a custom ruby-msg to avoid a name conflict -$:.unshift(File.join(File.dirname(__FILE__), '../vendor/ruby-ole/lib')) -$:.unshift(File.join(File.dirname(__FILE__), '../vendor/ruby-msg/lib')) $:.unshift(File.join(File.dirname(__FILE__), '../vendor/plugins/globalize2/lib')) -require 'memcache' - load "validate.rb" load "config.rb" load "format.rb" @@ -61,16 +57,6 @@ Rails::Initializer.run do |config| # config.log_level = :debug # # Specify gems that this application depends on and have them installed with rake gems:install - config.gem "locale", :version => '>=2.0.5' - config.gem "gettext", :version => '>=1.9.3' - config.gem "fast_gettext", :version => '>=0.4.8' - config.gem "rack", :version => '1.1.0' - config.gem "rdoc", :version => '>=2.4.3' - config.gem "recaptcha", :lib => "recaptcha/rails" - config.gem 'rspec', :lib => false, :version => '1.3.1' - config.gem 'rspec-rails', :lib => false, :version => '1.3.3' - config.gem 'routing-filter' - config.gem 'will_paginate', :version => '~> 2.3.11', :source => 'http://gemcutter.org' #GettextI18nRails.translations_are_html_safe = true # Use SQL instead of Active Record's schema dumper when creating the test database. diff --git a/config/preinitializer.rb b/config/preinitializer.rb new file mode 100644 index 000000000..3ad02415d --- /dev/null +++ b/config/preinitializer.rb @@ -0,0 +1,20 @@ +begin + require "rubygems" + require "bundler" +rescue LoadError + raise "Could not load the bundler gem. Install it with `gem install bundler`." +end + +if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24") + raise RuntimeError, "Your bundler version is too old for Rails 2.3." + + "Run `gem install bundler` to upgrade." +end + +begin + # Set up load paths for all bundled gems + ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__) + Bundler.setup +rescue Bundler::GemNotFound + raise RuntimeError, "Bundler couldn't find some gems." + + "Did you run `bundle install`?" +end |