From 880727f037ee7dfeeb3dbc9027622798d46fdbac Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 2 Nov 2020 20:02:12 +0900 Subject: [PATCH] Added help message for gem i webrick in un.rb --- lib/un.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/un.rb b/lib/un.rb index a759328ec4..39212d0fa9 100644 --- a/lib/un.rb +++ b/lib/un.rb @@ -326,7 +326,12 @@ def httpd "ServerName=NAME", "ServerSoftware=NAME", "SSLCertificate=CERT", "SSLPrivateKey=KEY") do |argv, options| - require 'webrick' + begin + require 'webrick' + rescue LoadError + puts "webrick is not found. You may need to `gem install webrick` to install webrick." + exit + end opt = options[:RequestTimeout] and options[:RequestTimeout] = opt.to_i [:Port, :MaxClients].each do |name| opt = options[name] and (options[name] = Integer(opt)) rescue nil