lib/nanoc3/cli/error_handler.rb in nanoc3-3.2.2 vs lib/nanoc3/cli/error_handler.rb in nanoc3-3.2.3
- old
+ new
@@ -167,13 +167,12 @@
# @return [String] The resolution for the given error
def resolution_for(error)
case error
when LoadError
# Get gem name
- matches = error.message.match(/no such file to load -- ([^\s]+)/)
- return nil if matches.size == 0
- lib_name = matches[1]
- gem_name = GEM_NAMES[$1]
+ matches = error.message.match(/(no such file to load|cannot load such file) -- ([^\s]+)/)
+ return nil if matches.nil?
+ gem_name = GEM_NAMES[matches[2]]
# Build message
if gem_name
"Try installing the '#{gem_name}' gem (`gem install #{gem_name}`) and then re-running the command."
end