jekyll과 github pages 연동 (1)

잡담

다른 분들의 블로그를 보고 jekyll과 github pages를 이용해서 블로그를 만들었다.
블로그에 대해 초짜라 뭐부터 해야할지 몰라서
일단은 블로그를 구성하다가 발생한 이슈들을 정리해고자 포스팅을 하기로 했다.

첫 번째 난관 - 의존성 문제

가장 먼저 만난 문제는 github pages와의 dependencies 문제이다.
github의 Dependency versions 부분을 들어가면 현재 github pages와의 dependencies가 잘 나와있다.
처음부터 이걸 기준으로 jekyll을 설치했어야 했는데…
일단은 안전하게 가보자! 란 마인드로 여기 페이지의 방법을 그대로 따라했다.
(굉장히 정리가 잘 되있어서 너무 감사합니다!)

그 결과, 아무런 문제도 없이 jekyll 수행도 되고 로컬에서 내 블로그도 잘 보였다.
기분 좋게 commit 하고 push 하고 나니… 이상한 메일을 하나 받았다.

1
2
3
4
5
6
7
8
9
The page build completed successfully, but returned the following warning:

You are currently using the 'redcarpet' Markdown engine, which is no longer supported by GitHub Pages and may cease working at any time. To ensure your site continues to build, remove the 'markdown' setting in your sites '_config.yml' file and confirm your site renders as expected. For more information, see https://help.github.com/articles/updating-your-markdown-processor-to-kramdown.

For information on troubleshooting Jekyll see:

https://help.github.com/articles/troubleshooting-jekyll-builds

If you have any questions you can contact us by replying to this email.

헐 ㅋ redcarpet은 더 이상 지원하지 않는단다.
그리고 또 하나!

1
2
3
4
5
6
7
8
9
The page build completed successfully, but returned the following warning:

You are attempting to use the 'pygments' highlighter, which is currently unsupported on GitHub Pages. Your site will use 'rouge' for highlighting instead. To suppress this warning, change the 'highlighter' value to 'rouge' in your '_config.yml' and ensure the 'pygments' key is unset. For more information, see https://help.github.com/articles/page-build-failed-config-file-error/#fixing-highlighting-errors.

For information on troubleshooting Jekyll see:

https://help.github.com/articles/troubleshooting-jekyll-builds

If you have any questions you can contact us by replying to this email.

pygments도 rouge로 바꾸라고 그런다.

이런거 받으면 기분이 안좋으니깐… 바로 _config.yml 에서 markdown을 kramdown으로, highlighter를 rouge로 바꾸고 jekyll을 다시 돌렸다.

이때 gem install kramdown, gem install rouge 를 통해 설치했는데… 이상한 버전이 설치됬었다.
그러니깐 highlighter가 정상적으로 작동을 하지 않던….

암튼 그래서 Gemfile을 다시 작성했다. 역시 여기에 정보들을 copy & paste 했다.

근데 이건 또 뭐지?

1
2
3
4
5
6
7
8
9
10
hun-mac-mini:haddm.github.io hun$ jekyll serve --watch
Configuration file: /Users/hun/git/blog/haddm.github.io/_config.yml
Source: /Users/hun/git/blog/haddm.github.io
Destination: /Users/hun/git/blog/haddm.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Dependency Error: Yikes! It looks like you don't have classifier-reborn or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- classifier-reborn' If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
ERROR: YOUR SITE COULD NOT BE BUILT:
------------------------------------
classifier-reborn

classifier-reborn???
ruby를 몰라서 google에 폭풍 검색…
잘 안나왔다.
일단 gem install classifier-reborn 을 통해 설치를 한번 해봤다.
?! 설치가 되네

1
2
3
4
5
6
hun-mac-mini:haddm.github.io hun$ gem install classifier-reborn
Fetching: classifier-reborn-2.0.4.gem (100%)
Successfully installed classifier-reborn-2.0.4
Parsing documentation for classifier-reborn-2.0.4
Done installing documentation for classifier-reborn after 0 seconds
1 gem installed

그럼 다시 jekyll을 돌려보자!

1
2
3
4
5
6
7
8
9
10
hun-mac-mini:haddm.github.io hun$ jekyll serve --watch
Configuration file: /Users/hun/git/blog/haddm.github.io/_config.yml
Source: /Users/hun/git/blog/haddm.github.io
Destination: /Users/hun/git/blog/haddm.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Dependency Error: Yikes! It looks like you don't have classifier-reborn or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- classifier-reborn' If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
ERROR: YOUR SITE COULD NOT BE BUILT:
------------------------------------
classifier-reborn

결과는 똑같았다.

다시 열심히 구글링!
stackoverflow에서 답변을 찾았다. (우왕 굳)

먼저 Gemfile 마지막 부분에 추가로 다음 2줄을 입력했다.

1
2
gem 'classifier', '1.3.4'
gem 'classifier-reborn', '2.0.4'

그리고는 다음 명령어를 순서대로 수행!

1
2
3
gem install bundler
rm Gemfile.lock
bundle install

그러고 나서 jekyll을 수행!

1
2
3
4
5
6
7
8
9
10
11
12
hun-mac-mini:haddm.github.io hun$ jekyll serve --watch
Configuration file: /Users/hun/git/blog/haddm.github.io/_config.yml
Source: /Users/hun/git/blog/haddm.github.io
Destination: /Users/hun/git/blog/haddm.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Build Warning: Layout 'none' requested in feed.xml does not exist.
done in 0.213 seconds.
Auto-regeneration: enabled for '/Users/hun/git/blog/haddm.github.io'
Configuration file: /Users/hun/git/blog/haddm.github.io/_config.yml
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.

우왕 굳!

잘 됬다.
(warning은 이유를 찾아봐야겠지만…)

결론

구글링과 stackoverflow는 짱짱맨

얼른 댓글이랑 이것저것 추가하는 방법을 알아봐야겠다.