Skip to content
Browse files

Merge pull request #332 from envygeeks/master

Clean up bundler requires.
  • Loading branch information...
2 parents 0acbcad + 9e7e703 commit f927223d7bf8303923fa7a7a9d6e54f84f87d2f8 @saturnflyer saturnflyer committed Aug 27, 2012
Showing with 15 additions and 16 deletions.
  1. +15 −16 config/preinitializer.rb
View
31 config/preinitializer.rb
@@ -1,19 +1,18 @@
-begin
- require "rubygems"
- require "bundler"
-rescue LoadError
- raise "Could not load the bundler gem. Install it with `gem install bundler`."
-end
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+# Lessens Debians need to edit.
+require "rubygems" rescue nil
-if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("1.0.0")
- raise RuntimeError, "Your bundler version is too old for Rails 2.3. " +
- "Run `gem install bundler` to upgrade."
-end
+# Since Bundler is not really a 'must have' for Rails development just send off
+# a warning and see if the sytem continues to load, the user can optionally use
+# RADIANT_NOWARNINGS to disable it.
-begin
- # Set up load paths for all bundled gems
- ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
- Bundler.setup
-rescue Bundler::GemNotFound => e
- raise RuntimeError, "Bundler couldn't find some gems: #{e}. Did you run `bundle install`?"
+if File.file?(ENV['BUNDLE_GEMFILE'])
+ begin
+ require 'bundler/setup'
+ rescue LoadError
+ unless ENV['RADIANT_NOWARNINGS'] == true
+ $stderr.puts 'WARNING: It seems you do not have Bundler installed.'
+ $stderr.puts 'WARNING: You can install it by doing `gem install bundler`'
+ end
+ end
end

0 comments on commit f927223

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