An issue arises when serving and viewing sites locally

Hey there guys. So, there’s an issue with trying to serve sites and view them locally. trying http://localhost:4000 shows an “unable to connect.” this appears in cmd:

C:\Users\james>jekyll serve
Configuration file: none
        Source: C:/Users/james
   Destination: C:/Users/james/_site
 Incremental build: disabled. Enable with --incremental
  Generating...
jekyll 3.6.2 | Error:  Permission denied @ rb_sysopen - C:/Users/james/NTUSER.DAT

C:\Users\james>cd c:/users/james/my-portfolio-site

c:\Users\james\my-portfolio-site>jekyll serve
C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler (LoadError)
    from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/plugin_manager.rb:48:in `require_from_bundler'
    from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/exe/jekyll:11:in `<top (required)>'
    from C:/Ruby24-x64/bin/jekyll:23:in `load'
    from C:/Ruby24-x64/bin/jekyll:23:in `<main>'

what can i do to resolve this?

ah - I think you are running jekyll one folder too high, you need to be inside my-portfolio-site when you run jekyll serve.

well, that is the first error, then I see you cd into the right place and get the other error.

Is bundler installed, how did you install jekyll?

Bundler i was not familiar with—i installed jekyll using gem install jekyll in the terminal.
I have now installed bundler using gem install bundler, but another error now occurs when i try to serve:

c:\Users\james\my-portfolio-site>cd c:\users\james
c:\Users\james>gem install bundler
Fetching: bundler-1.16.0.gem (100%)
Successfully installed bundler-1.16.0
Parsing documentation for bundler-1.16.0
Installing ri documentation for bundler-1.16.0
Done installing documentation for bundler after 53 seconds
1 gem installed

c:\Users\james>cd c:/users/james/my-portfolio-site

c:\Users\james\my-portfolio-site>jekyll serve
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/resolver.rb:288:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'minima (~> 2.0) x64-mingw32' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/resolver.rb:256:in `each'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/resolver.rb:256:in `verify_gemfile_dependencies_are_found!'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/resolver.rb:48:in `start'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/resolver.rb:22:in `resolve'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/definition.rb:257:in `resolve'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/definition.rb:170:in `specs'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/definition.rb:237:in `specs_for'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/definition.rb:226:in `requested_specs'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/runtime.rb:108:in `block in definition_method'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/runtime.rb:20:in `setup'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler.rb:107:in `setup'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/plugin_manager.rb:50:in `require_from_bundler'
        from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/exe/jekyll:11:in `<top (required)>'
        from C:/Ruby24-x64/bin/jekyll:23:in `load'
        from C:/Ruby24-x64/bin/jekyll:23:in `<main>'

did i install bundler correctly?

I think you need to do bundle exec jekyll serve

did you read:

Alrite. after doing bundle exec jekyll serve this showed up:

Could not find gem 'minima (~> 2.0) x64-mingw32' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.

After doing bundle install, the following appeared, and jekyll serve now works—i am now able to preview the site locally.

c:\Users\james\my-portfolio-site>bundle install
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using public_suffix 3.0.0
Using addressable 2.5.2
Using bundler 1.16.0
Using colorator 1.1.0
Using ffi 1.9.18 (x64-mingw32)
Using forwardable-extended 2.6.0
Using rb-fsevent 0.10.2
Using rb-inotify 0.9.10
Using sass-listen 4.0.0
Using sass 3.5.3
Using jekyll-sass-converter 1.5.0
Using listen 3.0.8
Using jekyll-watch 1.5.0
Using kramdown 1.15.0
Using liquid 4.0.0
Using mercenary 0.3.6
Using pathutil 0.16.0
Using rouge 2.2.1
Using safe_yaml 1.0.4
Using jekyll 3.6.2
Fetching jekyll-feed 0.9.2
Installing jekyll-feed 0.9.2
Fetching minima 2.1.1
Installing minima 2.1.1
Fetching thread_safe 0.3.6
Installing thread_safe 0.3.6
Fetching tzinfo 1.2.4
Installing tzinfo 1.2.4
Fetching tzinfo-data 1.2017.3
Installing tzinfo-data 1.2017.3
Bundle complete! 4 Gemfile dependencies, 25 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

c:\Users\james\my-portfolio-site>jekyll serve
Configuration file: c:/Users/james/my-portfolio-site/_config.yml
            Source: c:/Users/james/my-portfolio-site
       Destination: c:/Users/james/my-portfolio-site/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 4.808 seconds.
  Please add the following to your Gemfile to avoid polling for changes:
    gem 'wdm', '>= 0.1.0' if Gem.win_platform?
 Auto-regeneration: enabled for 'c:/Users/james/my-portfolio-site'
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

Solved. Thanks!