diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2011-02-13 09:47:10 +0100 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2011-02-13 09:47:10 +0100 |
commit | faf0db3336f84c744342e9fd071b9387a224bc08 (patch) | |
tree | 6d181a74b7690a03a8ad2846bdc7b9cf924ed9d2 /config | |
parent | afb98e10d6a014ba973611fc1012d4edaba476bc (diff) | |
download | ecs2-faf0db3336f84c744342e9fd071b9387a224bc08.tar.gz ecs2-faf0db3336f84c744342e9fd071b9387a224bc08.zip |
Bundler configuration.
Diffstat (limited to 'config')
-rw-r--r-- | config/boot.rb | 14 | ||||
-rw-r--r-- | config/environment.rb | 3 | ||||
-rw-r--r-- | config/preinitializer.rb | 21 |
3 files changed, 35 insertions, 3 deletions
diff --git a/config/boot.rb b/config/boot.rb index 858867e..0aa4ec3 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -125,4 +125,18 @@ module Rails end # All that for this: +class Rails::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 + Rails.boot! diff --git a/config/environment.rb b/config/environment.rb index ac78ff3..5736a17 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -37,9 +37,6 @@ Rails::Initializer.run do |config| # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net" # config.gem "sqlite3-ruby", :lib => "sqlite3" # config.gem "aws-s3", :lib => "aws/s3" - config.gem "simple-navigation" - config.gem "i18n", :version => '0.3.7' - # Only load the plugins named here, in the order given (default is alphabetical). # :all can be used as a placeholder for all plugins not explicitly named # config.plugins = [ :exception_notification, :ssl_requirement, :all ] diff --git a/config/preinitializer.rb b/config/preinitializer.rb new file mode 100644 index 0000000..4491f3a --- /dev/null +++ b/config/preinitializer.rb @@ -0,0 +1,21 @@ +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 + |