Prerequisites
Before you can use Jekyll to test a site, you must:
Install Jekyll.
Create a Jekyll site. For more information, see "Creating a GitHub Pages site with Jekyll."
We recommend using Bundler to install and run Jekyll. Bundler manages Ruby gem dependencies, reduces Jekyll build errors, and prevents environment-related bugs. To install Bundler:
Install Ruby. For more information, see "Installing Ruby" in the Ruby documentation.
Install Bundler. For more information, see "Bundler."
Building your site locally
Open Terminal.
Navigate to the publishing source for your site. For more information about publishing sources, see "About GitHub Pages."
Run bundle install.
Run your Jekyll site locally.
$ bundle exec jekyll serve
> Configuration file: /Users/octocat/my-site/_config.yml
> Source: /Users/octocat/my-site
> Destination: /Users/octocat/my-site/_site
> Incremental build: disabled. Enable with --incremental
> Generating...
> done in 0.309 seconds.
> Auto-regeneration: enabled for '/Users/octocat/my-site'
> Configuration file: /Users/octocat/my-site/_config.yml
> Server address: http://127.0.0.1:4000/
> Server running... press ctrl-c to stop.
To preview your site, in your web browser, navigate to http://localhost:4000.