Skip to main content

이 버전의 GitHub Enterprise Server는 다음 날짜에 중단됩니다. 2026-03-17. 중요한 보안 문제에 대해서도 패치 릴리스가 이루어지지 않습니다. 더 뛰어난 성능, 향상된 보안, 새로운 기능을 위해 최신 버전의 GitHub Enterprise Server로 업그레이드합니다. 업그레이드에 대한 도움말은 GitHub Enterprise 지원에 문의하세요.

Jekyll을 사용하여 로컬로 GitHub Pages 사이트 테스트

GitHub Pages 사이트를 로컬로 빌드하여 사이트의 변경 내용을 미리 확인하고 테스트할 수 있습니다.

누가 이 기능을 사용할 수 있나요?

GitHub Pages은(는) 조직의 GitHub Free 및 GitHub Free이(가) 있는 퍼블릭 리포지토리와 GitHub Pro, GitHub Team, GitHub Enterprise Cloud 및 GitHub Enterprise Server의 퍼블릭 및 프라이빗 리포지토리에서 사용할 수 있습니다.

Platform navigation

Anyone with read permissions for a repository can test a GitHub Pages site locally.

Prerequisites

Before you can use Jekyll to test a site, you must:

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:

  1. Install Ruby. For more information, see Installing Ruby in the Ruby documentation.
  2. Install Bundler. For more information, see Bundler.

If you see a Ruby error when you try to install Jekyll using Bundler, you may need to use a package manager, such as RVM or Homebrew, to manage your Ruby installation. For more information, see Troubleshooting in the Jekyll documentation.

Building your site locally

  1. Open TerminalTerminalGit Bash.

  2. Navigate to the publishing source for your site. For more information, see Configuring a publishing source for your GitHub Pages site.

  3. Run bundle install.

  4. 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.
    

    참고 항목

    • 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/:

      bundle exec jekyll serve --baseurl=""
      
  5. To preview your site, in your web browser, navigate to http://localhost:4000.

Updating the GitHub Pages gem

참고 항목

While the github-pages gem remains supported for some workflows, GitHub Actions is now the recommended approach for deploying and automating GitHub Pages sites.

Jekyll is an active open source project that is updated frequently. If the github-pages gem on your computer is out of date with the github-pages gem on the GitHub Pages server, your site may look different when built locally than when published on GitHub. To avoid this, regularly update the github-pages gem on your computer.

  1. Open TerminalTerminalGit Bash.
  2. Update the github-pages gem.
    • If you installed Bundler, run bundle update github-pages.
    • If you don't have Bundler installed, run gem update github-pages.

Further reading