Permalink
Browse files

Merge pull request #13696 from senny/engine_bin_rails_load_bundler

setup Bundler in engines `bin/rails` stub.
  • Loading branch information...
2 parents 6f0aa1d + 755fd79 commit c60e06261b9e26110f8ac639224c153d4ff77752 @senny senny committed Jan 21, 2014
Showing with 4 additions and 0 deletions.
  1. +4 −0 railties/lib/rails/generators/rails/plugin/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 c60e062

Please sign in to comment.