mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-30 12:45:18 +01:00
Override Rails' default gem handling and replace it with Bundler
Bundler does a better job of manage dependencies and is used by default in Rails 3 so this will move Tracks a bit closer towards a Rails 3 conversion.
This commit is contained in:
parent
e93a6970bd
commit
69cb08378d
2 changed files with 35 additions and 0 deletions
21
config/preinitializer.rb
Normal file
21
config/preinitializer.rb
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
begin
|
||||
require "rubygems"
|
||||
require "bundler"
|
||||
rescue LoadError
|
||||
raise "Could not load the bundler gem. Install it with `gem install bundler`."
|
||||
end
|
||||
|
||||
if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
|
||||
raise RuntimeError, "Your bundler version is too old for Rails 2.3." +
|
||||
"Run `gem install bundler` to upgrade."
|
||||
end
|
||||
|
||||
begin
|
||||
# Set up load paths for all bundled gems
|
||||
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
|
||||
Bundler.setup
|
||||
rescue Bundler::GemNotFound
|
||||
raise RuntimeError, "Bundler couldn't find some gems." +
|
||||
"Did you run `bundle install`?"
|
||||
end
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue