Browse files

Clean up bundler requires.

  • Loading branch information...
1 parent 85205bc commit 9e7e703b483b6e7da47c95da1a051596f64f470a @envygeeks envygeeks committed Apr 26, 2012
Showing with 15 additions and 16 deletions.
  1. +15 −16 config/preinitializer.rb
@@ -1,19 +1,18 @@
- require "rubygems"
- require "bundler"
-rescue LoadError
- raise "Could not load the bundler gem. Install it with `gem install bundler`."
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+# Lessens Debians need to edit.
+require "rubygems" rescue nil
-if <="1.0.0")
- raise RuntimeError, "Your bundler version is too old for Rails 2.3. " +
- "Run `gem install bundler` to upgrade."
+# 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.
- # 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

0 comments on commit 9e7e703

Please sign in to comment.