summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/additional_environment.rb.example3
-rw-r--r--config/boot.rb5
-rw-r--r--config/environment.rb6
-rw-r--r--config/environments/test.rb4
-rw-r--r--config/preinitializer.rb20
5 files changed, 25 insertions, 13 deletions
diff --git a/config/additional_environment.rb.example b/config/additional_environment.rb.example
index c50c37631..2a317a396 100644
--- a/config/additional_environment.rb.example
+++ b/config/additional_environment.rb.example
@@ -5,9 +5,6 @@
# Example:
#
# config.log_level = :debug
-# config.gem "example_plugin", :lib => false
-# config.gem "timesheet_plugin", :lib => false, :version => '0.5.0'
-# config.gem "aws-s3", :lib => "aws/s3"
# ...
#
diff --git a/config/boot.rb b/config/boot.rb
index 6ca837c82..cfc60f758 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -41,6 +41,11 @@ module Rails
class 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
diff --git a/config/environment.rb b/config/environment.rb
index 27f6972ea..3da0fe490 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -4,9 +4,6 @@
# you don't control web/app server and can't set it the proper way
# ENV['RAILS_ENV'] ||= 'production'
-# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.3.14' unless defined? RAILS_GEM_VERSION
-
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
@@ -54,9 +51,6 @@ Rails::Initializer.run do |config|
# It will automatically turn deliveries on
config.action_mailer.perform_deliveries = false
- config.gem 'coderay', :version => '~>1.0.0'
- config.gem 'net-ldap', :version => '~>0.2.2'
-
# Load any local configuration that is kept out of source control
# (e.g. gems, patches).
if File.exists?(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 79ee6af96..4ce45527a 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -23,7 +23,3 @@ config.action_controller.session = {
# Skip protect_from_forgery in requests http://m.onkey.org/2007/9/28/csrf-protection-for-your-existing-rails-application
config.action_controller.allow_forgery_protection = false
-
-config.gem "shoulda", :version => "~> 2.10.3"
-config.gem "edavis10-object_daddy", :lib => "object_daddy"
-config.gem "mocha"
diff --git a/config/preinitializer.rb b/config/preinitializer.rb
new file mode 100644
index 000000000..bece2b5d7
--- /dev/null
+++ b/config/preinitializer.rb
@@ -0,0 +1,20 @@
+begin
+ require "rubygems"
+ require "bundler"
+rescue LoadError
+ $stderr.puts "Redmine requires Bundler. Please install it with `gem install bundler`."
+ exit 1
+end
+
+if Gem::Version.new(Bundler::VERSION) < Gem::Version.new("1.0.21")
+ $stderr.puts "Redmine requires Bundler 1.0.21 (you're using #{Bundler::VERSION}).\nPlease install a newer version with `gem install bundler`."
+ exit 1
+end
+
+begin
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
+ Bundler.setup
+rescue Bundler::GemNotFound
+ $stderr.puts "Some gems may need to be installed or updated. Please run `bundle install`."
+ exit 1
+end