ruby-changes:64064
From: Hiroshi <ko1@a...>
Date: Thu, 10 Dec 2020 18:06:53 +0900 (JST)
Subject: [ruby-changes:64064] 4ccc66265c (master): Added help message for gem i webrick in gem server command
https://git.ruby-lang.org/ruby.git/commit/?id=4ccc66265c From 4ccc66265cdef0480eb6ff46f6be9f8de1a01891 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Tue, 3 Nov 2020 07:14:36 +0900 Subject: Added help message for gem i webrick in gem server command diff --git a/lib/rubygems/server.rb b/lib/rubygems/server.rb index a9529f7..61ea78b 100644 --- a/lib/rubygems/server.rb +++ b/lib/rubygems/server.rb @@ -1,5 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/server.rb#L1 # frozen_string_literal: true -require 'webrick' require 'zlib' require 'erb' require 'uri' @@ -424,6 +423,13 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; } https://github.com/ruby/ruby/blob/trunk/lib/rubygems/server.rb#L423 ERB def self.run(options) + begin + require 'webrick' + rescue LoadError + puts "webrick is not found. You may need to `gem install webrick` to install webrick." + exit + end + new(options[:gemdir], options[:port], options[:daemon], options[:launch], options[:addresses]).run end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/