From acef02ccfbcb1d357daaa3d4f53bfd0746af3fbb Mon Sep 17 00:00:00 2001 From: David Trasbo Date: Tue, 29 Jun 2010 11:10:00 +0200 Subject: [PATCH] Only tell users that the Rails gem is missing if it's actually the case [#2901 state:committed] --- railties/environments/boot.rb | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/railties/environments/boot.rb b/railties/environments/boot.rb index dd5e3b6..6686664 100644 --- a/railties/environments/boot.rb +++ b/railties/environments/boot.rb @@ -62,8 +62,12 @@ 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 -- 1.7.1