Skip to content
Browse files

Merge pull request #13696 from senny/engine_bin_rails_load_bundler

setup Bundler in engines `bin/rails` stub.
  • Loading branch information...
1 parent df5a873 commit e74e96acb219c93638bd6e34f72c00e239110fb3 @senny senny committed Jan 21, 2014
Showing with 4 additions and 0 deletions.
  1. +4 −0 railties/lib/rails/generators/rails/plugin_new/templates/bin/rails.tt
View
4 railties/lib/rails/generators/rails/plugin_new/templates/bin/rails.tt
@@ -3,5 +3,9 @@
ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/<%= name -%>/engine', __FILE__)
+# Set up gems listed in the Gemfile.
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
+
require 'rails/all'
require 'rails/engine/commands'

0 comments on commit e74e96a

Please sign in to comment.
Something went wrong with that request. Please try again.