1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Update testing-your-github-pages-site-locally-with-jekyll.md (#34182)

Co-authored-by: Tommy Byrd <tcbyrd@github.com>
Co-authored-by: Alex Nguyen <150945400+nguyenalex836@users.noreply.github.com>
Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
This commit is contained in:
Nitin Gupta
2024-08-13 14:53:10 -04:00
committed by GitHub
parent 2e9302df0c
commit 1bc312c6b6

View File

@@ -51,9 +51,17 @@ Before you can use Jekyll to test a site, you must:
{% note %} {% 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 %} {% endnote %}
1. To preview your site, in your web browser, navigate to `http://localhost:4000`. 1. To preview your site, in your web browser, navigate to `http://localhost:4000`.