I'm trying to use Webrick as a simple web server on my local machine. However, rather than use the Webrick included in Ruby 2.6, I'd like to use a copy outside of it. I'm using bundler and here's my Gemfile:
gem 'webrick', path: '/Users/jht/jht-webrick/webrick'
and when I do bundle info webrick I get:
* webrick (1.6.0)
Summary: HTTP server toolkit
Homepage: https://www.ruby-lang.org
Path: /Users/jht/jht-webrick/webrick
However, when I start it, it uses the included ruby 2.6 webrick. How can I make it use webrick specified in my Gemfile?
I am using this script (and you can see where I've tried to update the load path and load the source directly):
# $LOAD_PATH.unshift('../webrick/')
# puts "load path: #{$LOAD_PATH}"
# load '../webrick/lib/webrick.rb'
require 'webrick'
root = File.expand_path './public_html'
server = WEBrick::HTTPServer.new :Port => 8000, :DocumentRoot => root
trap 'INT' do server.shutdown end
server.start