# Can't connect to Localhost:4000

**URL:** <https://talk.jekyllrb.com/t/cant-connect-to-localhost-4000/6016>\
**Category:** Help\
**Created:** [May 8, 2021, 7:50am UTC](https://talk.jekyllrb.com/t/cant-connect-to-localhost-4000/6016 "2021-05-08T07:50:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![philbowell](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/philbowell/32/3542_2.png) [@philbowell](https://talk.jekyllrb.com/u/philbowell)\
**Post date:** [May 8, 2021, 7:50am UTC](https://talk.jekyllrb.com/t/cant-connect-to-localhost-4000/6016/1 "2021-05-08T07:50:12Z")

</div>

Hello all, I’m not to Jekyll and have successfully installed it on my Mac. When I run bundle exec jekyll build it works except I’m not able to see the site. I get a can’t connect to server.

My Gemfile is

```auto
# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

# gem "rails"
gem "jekyll"

```

and bundle update

```auto
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using public_suffix 4.0.6
Using bundler 2.2.17
Using eventmachine 1.2.7
Using concurrent-ruby 1.1.8
Using colorator 1.1.0
Using http_parser.rb 0.6.0
Using rexml 3.2.5
Using ffi 1.15.0
Using mercenary 0.4.0
Using rb-fsevent 0.10.4
Using safe_yaml 1.0.5
Using unicode-display_width 1.7.0
Using addressable 2.7.0
Using forwardable-extended 2.6.0
Using i18n 1.8.10
Using em-websocket 0.5.2
Using rb-inotify 0.10.1
Using rouge 3.26.0
Using terminal-table 2.0.0
Using liquid 4.0.3
Using listen 3.5.1
Using sassc 2.4.0
Using kramdown 2.3.1
Using pathutil 0.16.2
Using kramdown-parser-gfm 1.1.0
Using jekyll-watch 2.2.1
Using jekyll-sass-converter 2.1.0
Using jekyll 4.2.0
Bundle updated!

```

Any help greatly appreciated.

---

<div class="post-metadata">

**Author:** ![BillRaymond](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/billraymond/32/5963_2.png) [@BillRaymond](https://talk.jekyllrb.com/u/BillRaymond)\
**Post date:** [May 8, 2021, 9:21am UTC](https://talk.jekyllrb.com/t/cant-connect-to-localhost-4000/6016/2 "2021-05-08T09:21:51Z")

</div>

Can you provide the restore from your `bundle exec Jekyll build`?

---

<div class="post-metadata">

**Author:** ![philbowell](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/philbowell/32/3542_2.png) [@philbowell](https://talk.jekyllrb.com/u/philbowell)\
**Post date:** [May 8, 2021, 10:09am UTC](https://talk.jekyllrb.com/t/cant-connect-to-localhost-4000/6016/3 "2021-05-08T10:09:15Z")

</div>

Hi Bill, I’m new to this. Where do I find it?

---

<div class="post-metadata">

**Author:** ![philbowell](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/philbowell/32/3542_2.png) [@philbowell](https://talk.jekyllrb.com/u/philbowell)\
**Post date:** [May 8, 2021, 11:03am UTC](https://talk.jekyllrb.com/t/cant-connect-to-localhost-4000/6016/4 "2021-05-08T11:03:11Z")

</div>

This is what shows when I run `bundle exec jekyll serve`

```auto
Configuration file: none
            Source: /Users/Phil/Sites/jekyll-blog
       Destination: /Users/Phil/Sites/jekyll-blog/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
                    done in 0.043 seconds.
 Auto-regeneration: enabled for '/Users/Phil/Sites/jekyll-blog'
                    ------------------------------------------------
      Jekyll 4.2.0 Please append `--trace` to the `serve` command 
                     for any additional information or backtrace. 
                    ------------------------------------------------
/usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in `require_relative'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in `setup'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:100:in `process'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `each'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
	from /Users/Phil/.gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
	from /Users/Phil/.gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
	from /Users/Phil/.gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
	from /Users/Phil/.gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
	from /Users/Phil/.gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/exe/jekyll:15:in `<top (required)>'
	from /usr/local/lib/ruby/gems/3.0.0/bin/jekyll:23:in `load'
	from /usr/local/lib/ruby/gems/3.0.0/bin/jekyll:23:in `<top (required)>'
	from /Users/Phil/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli/exec.rb:63:in `load'
	from /Users/Phil/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli/exec.rb:63:in `kernel_load'
	from /Users/Phil/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli/exec.rb:28:in `run'
	from /Users/Phil/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli.rb:494:in `exec'
	from /Users/Phil/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /Users/Phil/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /Users/Phil/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /Users/Phil/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli.rb:30:in `dispatch'
	from /Users/Phil/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /Users/Phil/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/cli.rb:24:in `start'
	from /Users/Phil/.gem/ruby/3.0.0/gems/bundler-2.2.17/exe/bundle:49:in `block in <top (required)>'
	from /Users/Phil/.gem/ruby/3.0.0/gems/bundler-2.2.17/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
	from /Users/Phil/.gem/ruby/3.0.0/gems/bundler-2.2.17/exe/bundle:37:in `<top (required)>'
	from /usr/local/opt/ruby/bin/bundle:23:in `load'
	from /usr/local/opt/ruby/bin/bundle:23:in `<main>'

```

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [May 8, 2021, 11:12am UTC](https://talk.jekyllrb.com/t/cant-connect-to-localhost-4000/6016/5 "2021-05-08T11:12:04Z")

</div>

> [@philbowell](#):
>
> `/usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `require’: cannot load such file – webrick (LoadError)`

You need to resolve this issue:

```auto
/usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)

```

When you have an error, search StackOverflow/Google for a solution. This error was encountered in the Jekyll forums.

You can try installing Ruby 2.7 - as 3.0 is still new. Or reinstall global gems. You can try these solutions

> [@Load error: cannot load such file -- webrick](https://talk.jekyllrb.com/t/load-error-cannot-load-such-file-webrick/5417/3):
>
> There’s a [similar sounding issue about Jekyll and Ruby 3.0](https://github.com/jekyll/jekyll/issues/8523). Does the work-around mentioned there help? Alternatively, downgrading to [Homebrew’s Ruby@27](https://formulae.brew.sh/formula/ruby@2.7) might be necessary until all the kinks are worked out.

Later on the [thread](https://talk.jekyllrb.com/t/load-error-cannot-load-such-file-webrick/5417/6)

One solution for mac:

```auto
bundle add webrick

```

I’m using Mac and never had to directly install `webrick` in a project or globally.

You might need to make sure you’ve set up your PATH correctly, so that Ruby and gems can be found properly. Maybe webrick is installed globally but just can’t be found.
