diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb index d5af47bf40..bb7f7f61a6 100644 --- a/lib/rdoc/ri/driver.rb +++ b/lib/rdoc/ri/driver.rb @@ -1551,7 +1551,12 @@ or the PAGER environment variable. # Starts a WEBrick server for ri. def start_server - require 'webrick' + begin + require 'webrick' + rescue LoadError + puts "webrick is not found. You may need to `gem install webrick` to install webrick." + exit + end server = WEBrick::HTTPServer.new :Port => @server diff --git a/lib/rdoc/servlet.rb b/lib/rdoc/servlet.rb index e1d0f0ce82..bead186b00 100644 --- a/lib/rdoc/servlet.rb +++ b/lib/rdoc/servlet.rb @@ -3,7 +3,13 @@ require 'rdoc' require 'erb' require 'time' require 'json' -require 'webrick' + +begin + require 'webrick' +rescue LoadError + puts "webrick is not found. You may need to `gem install webrick` to install webrick." + exit +end ## # This is a WEBrick servlet that allows you to browse ri documentation.