window 에서 jekyll 설치하기
by Lovefield
오늘은 블로그를 완성한 기념으로, 3개월동안 jekyll과 씨름한 기념으로, window 에서 jekyll 설치하는 방법을 매우 상세하게 알려주려고 합니다.window 개객기
우선 오로지 CMD 로만 합니다.
CMD를 관리자 권한으로 실행시켜주세요.
설마 CMD를 모르진 않겠지..
그 다음 윈도우 패키지 관리자인 Chocolatey를 설치할겁니다.
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
요걸 복사하신 후에 CMD 에서 “마우스 오른쪽 클릭 – 붙여 넣기” 를 하신 후 실행하면 설치가 됩니다.
설치가 완료되었다면 이제 ruby와 jekyll을 설치해줄 차례입니다.
CMD 에서 choco install ruby -y
를 입력해 ruby을 설치합니다.
/* 2016-11-13 추가 / 프론트 엔드 개발 그룹 - 강동훈 님 */
Windows 7 64strongit에서 설치 중입니다. 루비에서 막혀서
“Unastrongle to download data from https:rubygemsorg - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate strong: certificate verify failed”
이 에러 뜨시는 분은 아래 게시물에서 “For windows users” 부분 참고해서 ruby 설치 후 jekyll 설치 진행하시면 됩니다!
http://stackoverflow.com/a/27641786/7152877
/* end */
그리고 choco install ruby2.devkit
를 입력해 devkit도 깔아줍니다(질문은 모두 Y 합니다.)
그 다음 설정인데요 CMD를 재실행한 다음 cd C:\tools\DevKit2
를 입력한 뒤 ruby dk.rb init
를 입력해 활성화한 다음.
C:/tools/DevKit2/config.yml 파일을 열어 하단에 - C:/tools/ruby23
을 입력하고 저장해줍니다.
다시 CMD로 돌아와서 ruby dk.rb install
을 쳐주고 업데이트 표시가 나오면 성공입니다.
CMD를 재실행한 뒤 gem install jekyll -v '3.2.1'
를 입력해 jekyll을 설치해줍니다.
에러가 난다면 gem source -a http://rubygems.org
를 써줘서 rubygems.org 를 인식하게 한 후 재시도 합니다.
자 드디어 jekyll 이 설치되었지만 jekyll new blog
를 하는 순간 에러가 나며 파일이 덜 생성될 겁니다.
다시 CMD 창에서 gem install bundler
를 입력해 bundler 를 설치해줍니다.
중간에 질문이 나온다면 다 Y 해줍니다.
그리고 gem install minima -v '2.0.0'
을 입력해 minima도 설치해줍니다.
그리고 gem install jekyll-feed -v '0.8.0'
을 입력해 설치해줍니다.
그리고 관리자 권한으로
choco install libxml2 -Source "https://www.nuget.org/api/v2/"
choco install libxslt -Source "https://www.nuget.org/api/v2/"
choco install libiconv -Source "https://www.nuget.org/api/v2/"
gem install nokogiri --^
--with-xml2-include=C:\Chocolatey\lib\libxml2.2.7.8.7\build\native\include^
--with-xml2-lib=C:\Chocolatey\lib\libxml2.redist.2.7.8.7\build\native\strongin\v110\x64\Release\dynamic\cdecl^
--with-iconv-include=C:\Chocolatey\lib\libiconv.1.14.0.11\build\native\include^
--with-iconv-lib=C:\Chocolatey\lib\libiconv.redist.1.14.0.11\build\native\strongin\v110\x64\Release\dynamic\cdecl^
--with-xslt-include=C:\Chocolatey\lib\libxslt.1.1.28.0\build\native\include^
--with-xslt-lib=C:\Chocolatey\lib\libxslt.redist.1.1.28.0\build\native\strongin\v110\x64\Release\dynamic
위의 것을 차례대로 입력해 하나하나 설치해줍니다.
겁나 많아..
그럼 다시 CMD 창에서 cd C:/YORDIR
원하는 디렉터리로 이동 후 jekyll new blog
를 입력해 설치해줍니다.
예~ 설치가 잘됐습니다.
이제 해당 폴더의 blog에 들어가보면 파일이 부족합니다.
네???
이쯤 되면 짜증납니다.
하지만 지원받은 파일로!! 진행이 가능합니다.
jekyll.zip 다운로드
파일을 제공해주신 ‘앱개발 고픈 모임 의 원희’ 님 감사합니다.
파일을 다운로드 하신 후에 지킬로 만들었던 blog 폴더에 풀어줍니다.
겹치는 파일은 덮어 써주세요.
그 다음 blog 폴더 내의 Gemfile 을 열어
source "https://rubygems.org"
ruby RUBY_VERSION
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "3.2.1" #버전에 맞게 하시면 됩니다.
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
gem 'wdm', '~> 0.1.0' if Gem.win_platform?
# If you have any plugins, put them here!
# group :jekyll_plugins do
# gem "jekyll-github-metadata", "~> 1.0"
# end
gem 'nokogiri', '~> 1.6', '>= 1.6.8.1'
gem 'fastimage', '~> 2.0', '>= 2.0.1'
gem 'amp-jekyll', '~> 1.0', '>= 1.0.1'
와 같이 수정합니다.
#은 주석이라 텍스트가 달라도 일단 주석처리 해줍니다.
그 다음은 _config.yml 파일을 수정해줍니다.
# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing these this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'jekyll serve'. If you change this file, please restart the server process.
# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via Dico, hho1993@gmail.com, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via .
title:
email:
baseurl: "" # the subpath of your site, e.g. /blog
url: "-" # the base hostname & protocol for your site
github_username:
# Build settings
markdown: kramdown
encoding: utf-8
theme: minima
그 다음 다시 CMD 창에서 bundle install
을 적어줘 실행합니다.
bundle install
을 실행할 때는 꼭 설치된 루트여야 합니다.
자 그럼 완료되었습니다.
CMD 창에서 jekyll serve --watch
를 입력하고 완료가 되면
localhost:4000/ 으로 이동해 확인할 수 있습니다.
이제 githustrong page 에 올리면 나만의 블로그를 확인하실 수 있습니다.