Windows에서 Jekyll 사이트를 로컬에서 테스트하기 위한 환경 설정 가이드입니다.
rubyinstaller-devkit-3.2.6-1-x64.exe3을 입력하여 MSYS2와 MINGW 개발 도구를 설치합니다.새로운 PowerShell 또는 명령 프롬프트를 열고 다음 명령어로 확인합니다:
ruby --version
출력 예시: ruby 3.2.6 (2024-xx-xx) [x64-mingw-ucrt]
PowerShell에서 다음 명령어를 실행합니다:
gem install jekyll bundler
설치 확인:
jekyll --version
bundle --version
프로젝트 디렉토리에서 다음 명령어를 실행합니다:
cd C:\git\Seong-Yong-Park.github.io
bundle install
다음 명령어로 로컬 서버를 시작합니다:
bundle exec jekyll serve
서버가 시작되면 다음 메시지가 표시됩니다:
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
브라우저에서 http://localhost:4000으로 접속하여 사이트를 확인할 수 있습니다.
RubyInstaller의 Devkit이 제대로 설치되지 않았을 수 있습니다. 다음을 시도해보세요:
ridk install
그리고 다시 gem install jekyll bundler를 실행합니다.
다른 포트를 사용할 수 있습니다:
bundle exec jekyll serve --port 4001
Windows에서 파일 감지 문제가 있을 수 있습니다. _config.yml에 다음을 추가하세요:
force_polling: true
Ctrl + Cbundle exec jekyll buildJEKYLL_ENV=production bundle exec jekyll serve