bundler icon indicating copy to clipboard operation
bundler copied to clipboard

Preinitializer example for Rails 2.3 in README needs to be improved

Open josevalim opened this issue 14 years ago • 0 comments

Preinitializer example with bundler for Rails 2.3 does not use require_dependency neither loads init.rb files. Something along those lines might fix it:

require "#{File.dirname(__FILE__)}/../vendor/bundler_gems/environment"

Gem.loaded_specs.values.each do |spec|
  require_dependency File.expand_path("lib", spec.full_gem_path)
  init = File.expand_path("init", spec.full_gem_path)
  require init if File.exists?(init)
end

Thanks Carlhuda! :)

josevalim avatar Nov 10 '09 23:11 josevalim