From c16296c79556ac660a0d7bd2df95e348a9e8df31 Mon Sep 17 00:00:00 2001 From: Yuji Yaginuma Date: Sat, 10 Dec 2016 09:21:28 +0900 Subject: gemfile entry method need to return an empty array rather than nil (#27318) This fixes the following error when executing rails new command. ``` (erb):9:in `block in template': undefined method `comment' for nil:NilClass (NoMethodError) ``` Follow up to #27288 --- railties/lib/rails/generators/app_base.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 187f4555a2..578aa23513 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -320,10 +320,10 @@ module Rails end def webpacker_gemfile_entry - if options[:webpack] - comment = "Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker" - GemfileEntry.github "webpacker", "rails/webpacker", nil, comment - end + return [] unless options[:webpack] + + comment = "Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker" + GemfileEntry.github "webpacker", "rails/webpacker", nil, comment end def jbuilder_gemfile_entry -- cgit v1.2.3