diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-07-05 09:56:59 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-07-05 09:56:59 +0100 |
commit | 74a7c2a1659ce9101c11e7bf6c53eeca2feef576 (patch) | |
tree | 959a25e29dca3e18f3fba6715549245648a26855 /config/boot.rb | |
parent | 5b78f72751b0bfa24f436420131e6ac6514ffa80 (diff) | |
parent | 74249524b08a2782d1f7272af3c66f081977367d (diff) |
Merge branch 'master' of github.com:sebbacon/alaveteli
Diffstat (limited to 'config/boot.rb')
-rw-r--r-- | config/boot.rb | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/config/boot.rb b/config/boot.rb index 30e4851a5..90fd9cd4d 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -54,6 +54,7 @@ module Rails def load_initializer require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" Rails::Initializer.run(:install_gem_spec_stubs) + Rails::GemDependency.add_frozen_gem_path end end @@ -71,13 +72,17 @@ module Rails gem 'rails' end rescue Gem::LoadError => load_error - $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.) - exit 1 + if load_error.message =~ /Could not find RubyGem rails/ + STDERR.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.) + exit 1 + else + raise + end end class << self def rubygems_version - Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion + Gem::RubyGemsVersion rescue nil end def gem_version @@ -91,15 +96,16 @@ module Rails end def load_rubygems + min_version = '1.3.2' require 'rubygems' - unless rubygems_version >= '0.9.4' - $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.) + unless rubygems_version >= min_version + $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.) exit 1 end rescue LoadError - $stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org) + $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org) exit 1 end @@ -115,5 +121,8 @@ module Rails end end + + # All that for this: Rails.boot! + |