class Rails::Generator::Commands::Create

Small addition to enable the enqueing of “bundle install”

def run_bundler(destination_root)

def run_bundler(destination_root)
  # thanks to http://spectator.in/2011/01/28/bundler-in-subshells/
  bundler_vars = %w(BUNDLE_GEMFILE RUBYOPT )
  command = %{"#{Gem.ruby}" -rubygems "#{Gem.bin_path('bundler', 'bundle')}" install --gemfile="#{File.join(File.expand_path(destination_root), 'Gemfile')}"}
  begin
    bundled_env = ENV.to_hash
    bundler_vars.each{ |var| ENV.delete(var) }
    print `#{command}`
  ensure
    ENV.replace(bundled_env)
  end
end