From 1bc312c6b6cf89d4533726166f729be08173f30f Mon Sep 17 00:00:00 2001 From: Nitin Gupta Date: Tue, 13 Aug 2024 14:53:10 -0400 Subject: [PATCH] Update testing-your-github-pages-site-locally-with-jekyll.md (#34182) Co-authored-by: Tommy Byrd Co-authored-by: Alex Nguyen <150945400+nguyenalex836@users.noreply.github.com> Co-authored-by: Kevin Heis --- ...ing-your-github-pages-site-locally-with-jekyll.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/content/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll.md b/content/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll.md index 4854ded618..90ca33e365 100644 --- a/content/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll.md +++ b/content/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll.md @@ -51,9 +51,17 @@ Before you can use Jekyll to test a site, you must: {% note %} - **Note:** If you've installed Ruby 3.0 or later (which you may have if you installed the default version via Homebrew), you might get an error at this step. That's because these versions of Ruby no longer come with `webrick` installed. + **Notes:** + * If you've installed Ruby 3.0 or later (which you may have if you installed the default version via Homebrew), you might get an error at this step. That's because these versions of Ruby no longer come with `webrick` installed. + + To fix the error, try running `bundle add webrick`, then re-running `bundle exec jekyll serve`. + + * If your `_config.yml` file's `baseurl` field contains your GitHub repository's link, you can use the following command when building locally to ignore that value and serve the site on `localhost:4000/`: + + ```shell + bundle exec jekyll serve --baseurl="" + ``` - To fix the error, try running `bundle add webrick`, then re-running `bundle exec jekyll serve`. {% endnote %} 1. To preview your site, in your web browser, navigate to `http://localhost:4000`.