From 76059a8913e46a930622c59be466c3202ed0dc22 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Mon, 20 Aug 2018 19:08:46 -0500 Subject: [PATCH] Add support for webpacker 4 prereleases For some reason, Gem::Specification.find_by_name("webpacker") doesn't identify Webpacker 4 prereleases like webpacker 4.0.0.pre.pre.2 while Gem::Specification.find_all_by_name("webpacker") does. I've tested Gem::Specification.find_all_by_name for possible undesired side-effects, like returning multiple results for Gem::Specification.find_all_by_name("react"), and it has worked as desired in all cases that I've tested it. --- lib/react_on_rails/utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/react_on_rails/utils.rb b/lib/react_on_rails/utils.rb index 48c99ddc3..14f9d8511 100644 --- a/lib/react_on_rails/utils.rb +++ b/lib/react_on_rails/utils.rb @@ -153,7 +153,7 @@ def self.generated_assets_full_path end def self.gem_available?(name) - Gem::Specification.find_by_name(name).present? + Gem::Specification.find_all_by_name(name).present? rescue Gem::LoadError false rescue StandardError