[Github] 기술 블로그 만들기 ep.01

ocean·2022년 10월 14일
0

Github

목록 보기
1/3

기술 블로그 만들기 ep.01

step 01. Github

  1. 새로운 Repository를 만든다.
    👉 이때 Repository 이름은 username.github.io 로 만든다

  2. clone 하기
    👉 나의 경우 소스트리를 통해 간편하게 clone 하였다.

  3. 파일 생성

cd mayacrew.github.io
echo "Hello World" > index.html
  1. commit & push

  2. 도메인에 username.github.io 검색해서 확인하기

step 02. Jekyll - 꾸미기

  1. Jekyll install
    -> 해당 과정에서 오류 발생 "You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory."

Jekyll install error

You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

  1. brew update / brew install
$ brew update
$ brew install rbenv ruby-build
$ rbenv versions

$ rbenv install 2.6.4
$ rbenv global 2.6.4
  1. path 설정
$ vim ~/.zhsrc

해당 코드 추가

[[ -d ~/.rbenv  ]] && \
  export PATH=${HOME}/.rbenv/bin:${PATH} && \
  eval "$(rbenv init -)"
$ source ~/.zhsrc
  1. Jekyll install
$ gem install jekyll bundler
  1. 오류 해결

참고한 사이트

  1. Jekyll 생성
$ cd mayacrew.github.io
$ jekyll new ./

👉 해당 코드를 실행하기전 index.html를 삭제해야한다. 파일이 있을 경우 모두 삭제하거나 위 명령어에서 --force를 붙여 실행해야한다.

  1. bundle install / 로컬서버 띄우기
$ bundle install
$ bundle exec jekyll serve
  1. http://127.0.0.1:4000/ 접속

  2. commit / push -> mayacrew.github.io 재접속 확인

0개의 댓글