Implemented bundler. No more confusiong with gem versions!
This commit is contained in:
parent
80691c441b
commit
20b7db306b
5 changed files with 95 additions and 5 deletions
|
|
@ -106,5 +106,20 @@ module Rails
|
|||
end
|
||||
end
|
||||
|
||||
# Bundler requirements
|
||||
class Rails::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
|
||||
|
||||
# All that for this:
|
||||
Rails.boot!
|
||||
|
|
|
|||
|
|
@ -55,13 +55,13 @@ Rails::Initializer.run do |config|
|
|||
# config.gem "sqlite3-ruby", :lib => "sqlite3"
|
||||
# config.gem "aws-s3", :lib => "aws/s3"
|
||||
#
|
||||
# library for parsing/writing files from/to csv-file
|
||||
config.gem "fastercsv"
|
||||
config.gem "prawn", :version => '<=0.6.3'
|
||||
config.gem "haml", :version => '>=2.0.6'
|
||||
config.gem "routing-filter", :lib => "routing_filter"
|
||||
# config.gem "fastercsv"
|
||||
# config.gem "prawn", :version => '<=0.6.3'
|
||||
# config.gem "haml", :version => '>=2.0.6'
|
||||
# config.gem "routing-filter", :lib => "routing_filter"
|
||||
|
||||
# The internationalization framework can be changed to have another default locale (standard is :en) or more load paths.
|
||||
# library for parsing/writing files from/to csv-file
|
||||
# All files from config/locales/*.rb,yml are added automatically.
|
||||
# config.i18n.load_path << Dir[File.join(RAILS_ROOT, 'my', 'locales', '*.{rb,yml}')]
|
||||
config.i18n.default_locale = :de
|
||||
|
|
|
|||
20
config/preinitializer.rb
Normal file
20
config/preinitializer.rb
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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