[jekyll] jekyll install

개요

오랫동안 방치했던 블로그를 다시 열면서
jekyll를 다시 설치해봤습니다.

설치

jekyll 프로젝트로 이동하여 아래 명령어를 입력합니다.

gem install jekyll bundler
Fetching pathutil-0.16.2.gem
Fetching terminal-table-3.0.2.gem
Fetching webrick-1.8.1.gem
Fetching forwardable-extended-2.6.0.gem
Fetching rouge-4.1.3.gem
Fetching mercenary-0.4.0.gem
Fetching safe_yaml-1.0.5.gem
Fetching unicode-display_width-2.4.2.gem
Fetching liquid-4.0.4.gem
Fetching kramdown-2.4.0.gem
Fetching kramdown-parser-gfm-1.1.0.gem
Fetching ffi-1.15.5.gem
Fetching rb-inotify-0.10.1.gem
Fetching rb-fsevent-0.11.2.gem
Fetching listen-3.8.0.gem
Fetching jekyll-watch-2.2.1.gem
Fetching google-protobuf-3.24.2-arm64-darwin.gem
Fetching sass-embedded-1.66.1-x86_64-darwin.gem
Fetching jekyll-sass-converter-3.0.0.gem
Fetching concurrent-ruby-1.2.2.gem
Fetching i18n-1.14.1.gem
Fetching http_parser.rb-0.8.0.gem
Fetching eventmachine-1.2.7.gem
Fetching em-websocket-0.5.3.gem
Fetching colorator-1.1.0.gem
Fetching public_suffix-5.0.3.gem
Fetching addressable-2.8.5.gem
Fetching jekyll-4.3.2.gem
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

웁스. 권한 문제가 발생했네요.
맥북 기본 설치된 ruby를 사용하다보니 해당 디렉토리 권한이 없다고 합니다.
이럴 때는 sudo..아니아니 rbenv부터 찬찬히 해봅시다.

참고 : https://jojoldu.tistory.com/288

rbenv

rbenv를 설치해봅시다.

brew update
brew install rbenv ruby-build

rbenv 설치가 잘됐는지.. 확인도 해보죠.

rbenv versions
* system

system. 즉 os에서 기본 제공하는 ruby를 사용하고 있네요.
아마 버전도 상당히 낮은 ruby를 사용하고 있을꺼라 예상되네요.
이제 직접 ruby를 설치해봅시다.
현재 기준 3.2.2이 최신 버전입니다. 이걸로 설치해보겠습니다.

rbenv install 3.2.2
To follow progress, use 'tail -f /var/folders/2_/8rvvvv_533d_dzj5y82h6lj00000gn/T/ruby-build.20230904230149.5486.log' or pass --verbose
Downloading openssl-3.1.1.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/b3aa61334233b852b63ddb048df181177c2c659eb9d4376008118f9c08d07674
Installing openssl-3.1.1...
Installed openssl-3.1.1 to /.rbenv/versions/3.2.2

Downloading ruby-3.2.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz
Installing ruby-3.2.2...
ruby-build: using readline from homebrew
ruby-build: using libyaml from homebrew
Installed ruby-3.2.2 to /.rbenv/versions/3.2.2


NOTE: to activate this Ruby version as the new default, run: rbenv global 3.2.2

가장 밑에 note를 보면 새로운 ruby를 설치했으니 default로 셋팅하라고 합니다.
따라해보겠습니다.

rbenv global 3.2.2

다시 버전을 확인해 보면?

rbenv versions
  system
* 3.2.2 (set by /.rbenv/version)

깔끔하게 잘 됐네요.
이제 path에 추가하여 어디서든 ruby 명령어를 사용해봅시다.

vim ~/.zshrc

# 아래 코드 추가
[[ -d ~/.rbenv  ]] && \
  export PATH=${HOME}/.rbenv/bin:${PATH} && \
  eval "$(rbenv init -)"
  
# source 명령어로 적용
source ~/.zshrc

자.. 드디어 모든 준비가 끝났습니다.
이제 bundler를 설치합니다.

bundler

gem install bundler
Fetching bundler-2.4.19.gem
Successfully installed bundler-2.4.19
Parsing documentation for bundler-2.4.19
Installing ri documentation for bundler-2.4.19
Done installing documentation for bundler after 0 seconds
1 gem installed

A new release of RubyGems is available: 3.4.10 → 3.4.19!
Run `gem update --system 3.4.19` to update your installation.

아직 마지막 관문이 남아 있습니다.

gem install jekyll bundler
Fetching unicode-display_width-2.4.2.gem
Fetching terminal-table-3.0.2.gem
Fetching safe_yaml-1.0.5.gem
Fetching rouge-4.1.3.gem
Fetching forwardable-extended-2.6.0.gem
Fetching mercenary-0.4.0.gem
Fetching webrick-1.8.1.gem
Fetching pathutil-0.16.2.gem
Fetching liquid-4.0.4.gem
Fetching kramdown-2.4.0.gem
Fetching kramdown-parser-gfm-1.1.0.gem
Fetching ffi-1.15.5.gem
Fetching rb-inotify-0.10.1.gem
Fetching rb-fsevent-0.11.2.gem
Fetching listen-3.8.0.gem
Fetching jekyll-watch-2.2.1.gem
Fetching google-protobuf-3.24.2-arm64-darwin.gem
Fetching sass-embedded-1.66.1-arm64-darwin.gem
Fetching jekyll-sass-converter-3.0.0.gem
Fetching concurrent-ruby-1.2.2.gem
Fetching i18n-1.14.1.gem
Fetching http_parser.rb-0.8.0.gem
Fetching eventmachine-1.2.7.gem
Fetching em-websocket-0.5.3.gem
Fetching jekyll-4.3.2.gem
Fetching colorator-1.1.0.gem
Fetching public_suffix-5.0.3.gem
Fetching addressable-2.8.5.gem
Successfully installed webrick-1.8.1
Successfully installed unicode-display_width-2.4.2
Successfully installed terminal-table-3.0.2
Successfully installed safe_yaml-1.0.5
Successfully installed rouge-4.1.3
Successfully installed forwardable-extended-2.6.0
Successfully installed pathutil-0.16.2
Successfully installed mercenary-0.4.0
Successfully installed liquid-4.0.4
Successfully installed kramdown-2.4.0
Successfully installed kramdown-parser-gfm-1.1.0
Building native extensions. This could take a while...
Successfully installed ffi-1.15.5
Successfully installed rb-inotify-0.10.1
Successfully installed rb-fsevent-0.11.2
Successfully installed listen-3.8.0
Successfully installed jekyll-watch-2.2.1
Successfully installed google-protobuf-3.24.2-arm64-darwin
Successfully installed sass-embedded-1.66.1-arm64-darwin
Successfully installed jekyll-sass-converter-3.0.0
Successfully installed concurrent-ruby-1.2.2
Successfully installed i18n-1.14.1
Building native extensions. This could take a while...
Successfully installed http_parser.rb-0.8.0
Building native extensions. This could take a while...
Successfully installed eventmachine-1.2.7
Successfully installed em-websocket-0.5.3
Successfully installed colorator-1.1.0
Successfully installed public_suffix-5.0.3
Successfully installed addressable-2.8.5
Successfully installed jekyll-4.3.2
Parsing documentation for webrick-1.8.1
Installing ri documentation for webrick-1.8.1
Parsing documentation for unicode-display_width-2.4.2
Installing ri documentation for unicode-display_width-2.4.2
Parsing documentation for terminal-table-3.0.2
Installing ri documentation for terminal-table-3.0.2
Parsing documentation for safe_yaml-1.0.5
Installing ri documentation for safe_yaml-1.0.5
Parsing documentation for rouge-4.1.3
Installing ri documentation for rouge-4.1.3
Parsing documentation for forwardable-extended-2.6.0
Installing ri documentation for forwardable-extended-2.6.0
Parsing documentation for pathutil-0.16.2
Installing ri documentation for pathutil-0.16.2
Parsing documentation for mercenary-0.4.0
Installing ri documentation for mercenary-0.4.0
Parsing documentation for liquid-4.0.4
Installing ri documentation for liquid-4.0.4
Parsing documentation for kramdown-2.4.0
Installing ri documentation for kramdown-2.4.0
Parsing documentation for kramdown-parser-gfm-1.1.0
Installing ri documentation for kramdown-parser-gfm-1.1.0
Parsing documentation for ffi-1.15.5
Installing ri documentation for ffi-1.15.5
Parsing documentation for rb-inotify-0.10.1
Installing ri documentation for rb-inotify-0.10.1
Parsing documentation for rb-fsevent-0.11.2
Installing ri documentation for rb-fsevent-0.11.2
Parsing documentation for listen-3.8.0
Installing ri documentation for listen-3.8.0
Parsing documentation for jekyll-watch-2.2.1
Installing ri documentation for jekyll-watch-2.2.1
Parsing documentation for google-protobuf-3.24.2-arm64-darwin
Installing ri documentation for google-protobuf-3.24.2-arm64-darwin
Parsing documentation for sass-embedded-1.66.1-arm64-darwin
Installing ri documentation for sass-embedded-1.66.1-arm64-darwin
Parsing documentation for jekyll-sass-converter-3.0.0
Installing ri documentation for jekyll-sass-converter-3.0.0
Parsing documentation for concurrent-ruby-1.2.2
Installing ri documentation for concurrent-ruby-1.2.2
Parsing documentation for i18n-1.14.1
Installing ri documentation for i18n-1.14.1
Parsing documentation for http_parser.rb-0.8.0
unknown encoding name "chunked\r\n\r\n25" for ext/ruby_http_parser/vendor/http-parser-java/tools/parse_tests.rb, skipping
Installing ri documentation for http_parser.rb-0.8.0
Parsing documentation for eventmachine-1.2.7
Installing ri documentation for eventmachine-1.2.7
Parsing documentation for em-websocket-0.5.3
Installing ri documentation for em-websocket-0.5.3
Parsing documentation for colorator-1.1.0
Installing ri documentation for colorator-1.1.0
Parsing documentation for public_suffix-5.0.3
Installing ri documentation for public_suffix-5.0.3
Parsing documentation for addressable-2.8.5
Installing ri documentation for addressable-2.8.5
Parsing documentation for jekyll-4.3.2
Installing ri documentation for jekyll-4.3.2
Done installing documentation for webrick, unicode-display_width, terminal-table, safe_yaml, rouge, forwardable-extended, pathutil, mercenary, liquid, kramdown, kramdown-parser-gfm, ffi, rb-inotify, rb-fsevent, listen, jekyll-watch, google-protobuf, sass-embedded, jekyll-sass-converter, concurrent-ruby, i18n, http_parser.rb, eventmachine, em-websocket, colorator, public_suffix, addressable, jekyll after 7 seconds
Successfully installed bundler-2.4.19
Parsing documentation for bundler-2.4.19
Done installing documentation for bundler after 0 seconds
29 gems installed
euisunchoi@Euiui-MacBookAir github.io % bundle exec jekyll serve
Could not find gem 'jekyll (~> 3.5)' in locally installed gems.

The source contains the following gems matching 'jekyll':
  * jekyll-4.3.2
Run `bundle install` to install missing gems.

막판에 missing gems가 있다면서 bundle install을 실행시키라 하는군요.

bundle install
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Fetching rexml 3.2.6
Fetching mercenary 0.3.6
Fetching rouge 3.30.0
Fetching faraday-net_http 3.0.2
Fetching jekyll-paginate 1.1.0
Fetching sass-listen 4.0.0
Installing faraday-net_http 3.0.2
Installing jekyll-paginate 1.1.0
Installing sass-listen 4.0.0
Installing mercenary 0.3.6
Installing rexml 3.2.6
Fetching faraday 2.7.10
Fetching sass 3.7.4
Installing rouge 3.30.0
Installing faraday 2.7.10
Fetching sawyer 0.9.2
Installing sass 3.7.4
Installing sawyer 0.9.2
Fetching octokit 4.25.1
Fetching jekyll-sass-converter 1.5.2
Installing octokit 4.25.1
Installing jekyll-sass-converter 1.5.2
Fetching jekyll-gist 1.5.0
Fetching jekyll 3.9.3
Installing jekyll-gist 1.5.0
Installing jekyll 3.9.3
Fetching jekyll-feed 0.17.0
Fetching jekyll-include-cache 0.2.1
Fetching jekyll-seo-tag 2.8.0
Fetching jekyll-sitemap 1.4.0
Installing jekyll-feed 0.17.0
Installing jekyll-include-cache 0.2.1
Installing jekyll-seo-tag 2.8.0
Installing jekyll-sitemap 1.4.0
Fetching minimal-mistakes-jekyll 4.24.0
Installing minimal-mistakes-jekyll 4.24.0
Bundle complete! 5 Gemfile dependencies, 39 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from sass:

Ruby Sass has reached end-of-life and should no longer be used.

* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
  primary implementation: https://sass-lang.com/install

* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
  sassc gem: https://github.com/sass/sassc-ruby#readme

* For more details, please refer to the Sass blog:
  https://sass-lang.com/blog/posts/7828841

드디어 끝난것 같습니다.
이제 로컬에 띄우기만 하면!!

bundle exec jekyll serve
Configuration file: /IdeaProjects/github.io/_config.yml
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
            Source: /IdeaProjects/github.io
       Destination: /IdeaProjects/github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
       Jekyll Feed: Generating feed for posts
                    done in 1.336 seconds.
 Auto-regeneration: enabled for '/IdeaProjects/github.io'
bundler: failed to load command: jekyll (/.rbenv/versions/3.2.2/bin/jekyll)
<internal:/.rbenv/versions/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require': cannot load such file -- webrick (LoadError)

순순히 끝나지 않는군요.
마지막으로 webrick을 bundle에 추가해줍니다.

bundle add webrick

Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...

다시 로컬에 띄우겠습니다.

Run Jekyll

bundle exec jekyll serve
Configuration file: /IdeaProjects/github.io/_config.yml
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
            Source: /IdeaProjects/github.io
       Destination: /IdeaProjects/github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
       Jekyll Feed: Generating feed for posts
                    done in 0.805 seconds.
 Auto-regeneration: enabled for '/IdeaProjects/github.io'
    Server address: http://127.0.0.1:4000
  Server running... press ctrl-c to stop.

깔끔하게 올라왔습니다.
브라우저 주소창에 아래와 같이 입력합니다.
http://localhost:4000

못난 사이트 하나 올라옵니다.
jekyll-browser

완료!!

jekyll blog github.io

2023

[linux] shell script version compare

최대 1 분 소요

개요 linux를 사용하다 보면 version 비교하는 기능이 필요합니다. 특히 기존 설치된 패키지의 version을 확인하여 업데이트할 경우가 있겠죠. 아래와 같이 간단한 shell script로 구현할 수 있습니다.

[jenkins] jenkins docker install

2 분 소요

ci/cd 오픈소스 도구로 가장 많이 사랑 받는 jenkins에 대해 포스팅 해보겠습니다. 먼저 설치부터 해야겠지요? 항상 패키지 매니저로 설치했었는데 이번에는 docker로 설치해보도록 하겠습니다.

[springboot] springboot history

2 분 소요

springboot 탄생 배경 springboot란 spring framework를 좀 더 쉽게 개발/배포할려는 목적으로 만들어 졌습니다. 2012년 Mike Youngstrom은 spring 프레임워크에서 컨테이너 없는 웹 애플리케이션 아키텍처에 대한 지원을 요청하는 spring...

[springboot] springboot3 querydsl 적용

1 분 소요

개요 springboot3로 메이저 업그레이드 되면서 JPA + querydsl 셋팅 환경에 변화가 생겼습니다. 기존 의존성으로는 작동하지 않고 jakarta classification을 추가해야 작동하는 이슈가 발생합니다. springboot3부터 javax -> jakar...

[springboot] springboot3 migration

최대 1 분 소요

개요 2022년 하반기에 springboot3가 공식 release 되었습니다. springboot2가 2018년 상반기에 release되고 나서 새롭게 판올림 버전으로 가장 큰 변화로는 아래와 같습니다. spring framework 6 적용 최소 사양 JDK 17 ...

[springboot] springboot initializer

1 분 소요

개요 항상 intellij ultimate 버전만 사용하고 있었는데 무슨 바람이 난건지.. intellij ce 버전에 도전하였습니다. springboot 프로젝트 생성이며.. 그 밖에 기본적으로 될꺼라 싶은것 중에 안되는 녀석들도 꽤 있더군요. 이번 시간엔 간단하게 spingbo...

[querydsl] querydsl No release for a long time

최대 1 분 소요

개요 JPA를 spring data jpa + querydsl과의 조합으로 접하는 경우가 많습니다. spring data jpa에서 제공해주는 specification으로도 충분히 해낼수 있지만 querydsl에 비할바는 아닙니다. entity에 wrapper Q클래스를 생성하여 ...

[jekyll] jekyll install

6 분 소요

개요 오랫동안 방치했던 블로그를 다시 열면서 jekyll를 다시 설치해봤습니다. 설치 jekyll 프로젝트로 이동하여 아래 명령어를 입력합니다. gem install jekyll bundler Fetching pathutil-0.16.2.gem Fetching terminal-t...

맨 위로 이동 ↑

2021

[linux] Parse yaml

최대 1 분 소요

bash를 사용하여 yaml 파일을 파싱 및 환경 변수로 손쉽게 등록할 수 있습니다.

[유틸리티] Mock Http Status Test

최대 1 분 소요

외부 통신에 대한 Error 처리는 앱을 더욱 더 견고하게 만들 수 있습니다. Error 처리를 위해 엔드포인트에 대한 Http Status Code를 억지로 생성하는것은 매우 귀찮은 일이라고 할까요? 보다 간편하게 Mock 서버를 두는게 더 효율적이라고 볼 수 있습니다.

맨 위로 이동 ↑