FAQ: Create a Static Website Using Jekyll - Preview Your Site Locally

This community-built FAQ covers the “Preview Your Site Locally” exercise from the lesson “Create a Static Website Using Jekyll”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Deploy a Website

FAQs on the exercise Preview Your Site Locally

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

1 Like

I need help with this part because I have been stuck on part four for days. I just can’t seem to understand what it wants me to do, and how to do it. I have to do these courses for school, and this assignment is due soon. Could you help me? :confounded:

1 Like

This is a crappy course - actually the terminal is super slow to begin with - almost two decades old - you need to type alphabet by alphabet and still even if you cd into the folder and ran jekyll serve the instructions wont let you proceed forward. The popups are f***ing annoying for a typical developer. I am totally pissed of with this stupid course already.

4 Likes

This exercise and this course is broken.

In the portion where you create the site with jekyll ‘jekyll new personal-website’, change to the site directory ‘cd personal-website’, and execute ‘jekyll serve’, it gives me the following error message:

/home/ccuser/.gem/ruby/2.3.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:31:
in `go': invalid argument: --port  (OptionParser::InvalidArgument)
from /home/ccuser/.gem/ruby/2.3.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
from /home/ccuser/.gem/ruby/2.3.0/gems/jekyll-3.1.3/bin/jekyll:13:in `<top (required)>'
from /home/ccuser/.bin/jekyll:30:in `load'
from /home/ccuser/.bin/jekyll:30:in `<main>'
9 Likes

I am stuck at the same step. It is no use continuing. This broken course was reported months ago. Who is fixing this course?

2 Likes

I got this to work, kind of. If you install jekyll on your pc, and use that to do the steps up to the “serve” command, you can then cd to the directory “personal-site”, and type " jekyll serve ", and get something like:
lt@lt-desktop:~/demonfinder$ jekyll serve
Configuration file: /home/lt/demonfinder/_config.yml
Source: /home/lt/demonfinder
Destination: /home/lt/demonfinder/_site
Incremental build: disabled. Enable with --incremental
Generating…
done in 0.34 seconds.
Auto-regeneration: enabled for ‘/home/lt/demonfinder’
Configuration file: /home/lt/demonfinder/_config.yml
Server address: http://127.0.0.1:4000/
Server running… press ctrl-c to stop.

( obviously I named my site " demonfinder" rather than " personal-site". )

Next, go to your browser, and type in “http://localhost:4000

There, you should see a page like was shown earlier in the course, that says " Welcome to jekyll" and has a page title of “your awesome site”.

Hope that helps!

-LT

1 Like

… wat?

it’s clearly showing some errors in ruby files, even tho I’ve name project as they wanted…
plus the server is set to http://localhost:8000/ I’ve also changed to port :4000 with no luck !
let’s see what’s gonna happen next


Section 5: Preview Your Site Locally

Following the instructions/directions but getting localhost:8000 instead of localhost:4000 and receive these errors when attempting to view at

localhost:8000 and localhost:4000

This site can’t be reached

localhost refused to connect.

Try:

  • Checking the connection
  • [Checking the proxy and the firewall

ERR_CONNECTION_REFUSED

Not sure how to proceed.

I just reversed the steps and it woreked for me. not the website link though.

jekyll serve /home/ccuser/.gem/ruby/2.3.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:31:in `go': invalid argument: --port (OptionParser::InvalidArgument) from /home/ccuser/.gem/ruby/2.3.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program' from /home/ccuser/.gem/ruby/2.3.0/gems/jekyll-3.1.3/bin/jekyll:13:in `<top (required)>' from /home/ccuser/.bin/jekyll:30:in `load' from /home/ccuser/.bin/jekyll:30:in `<main>' cd personal-website
bash: cd: personal-website: No such file or directory
$

1 Like

I typed in “cd personal-website” and it let me go to step 2 and i put ‘jekyll serve’. Not a fan of the course AT ALL, makes everything complicated for no reason

1 Like

The jekyll script is trying to pass in the options ‘–port’ and the ‘PORT’ environment variable. There doesn’t seem to be any $PORT set in the shell, so jekyll fails. I don’t know what port it’s supposed to end up on, but trying ‘env PORT=8000 jekyll serve’ didn’t seem to work. But if someone can tell us what port that should be, I think this would work.

2021 here and the course is still broken!?!

3 Likes

Jan 2022 Still broken…

Feb 2022 still the same, no progress

Mar 31st still no solution

October 26 and still not working

thank you so much this worked for me as well

jekyll serve worked for me

jekyll serve command is not working. I am getting following error:

/home/ccuser/.gem/ruby/2.3.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:31:in `go': invalid argument: --port  (OptionParser::InvalidArgument)
        from /home/ccuser/.gem/ruby/2.3.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
        from /home/ccuser/.gem/ruby/2.3.0/gems/jekyll-3.1.3/bin/jekyll:13:in `<top (required)>'
        from /home/ccuser/.bin/jekyll:30:in `load'
        from /home/ccuser/.bin/jekyll:30:in `<main>'

This error has been producing since 2019. We have reached in 2024. Please fix it.

1 Like