깃헙 블로그 개설 as side project diary (ruby, jekyll, github)

2023. 8. 5. 00:14개발

오늘 나를 움직인 문장

  • build in public
  • 잘 만든 하나를 올리려고 하지 말고, 하루에 6-7개씩 올리는 게 낫다
  • 작게라도 무조건 시작
  • 기록, 회고, 성취, 축하, 자랑

그 시작으로 사이드 프로젝트를 진행 및 기록하기 위한 깃헙 블로그를 오픈해서 1일 1커밋에 도전!

  • M1 MacBook Air (2020)
  • Ventura 13.4.1 (c)

1. 루비 설치

1-1. rbenv 설치

pipenv가 떠오르는 버전 관리 위한 가상 환경 어쩌고 저쩌고

brew install rbenv ruby-build
rbenv install -l
rbenv install 3.2.2
rbenv global 3.2.2
rbenv versions

1-2. bundler 설치 중 에러

에러는 모두 친구

rbenv가 아닌 맥 시스템 기본 루비가 돌아가서 생기는 문제라고 한다..

gem install bundler
...
ERROR:  While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

1-3 에러 해결

서치는 달인이지만, 시키는 대로도 못하는 편..

vi ~/.zshrc

i #insert mode & add below;
[[ -d ~/.rbenv ]] && \
export PATH = ${HOME}/.rbenv/bin:${PATH} && \
eval "$(rbenv init -)"

esc #leave insert mode
:wq # save and quit

source ~/.zshrc
/Users/hughqlee/.zshrc:2: bad assignment # 편집한 내용 중 2째줄에 문제가 있다고 한다..

왜 쓸데없이 PATH = ${HOME} 이렇게 등호 좌우로 공백(space)을 넣은걸까...

# 공백 제거 to PATH=$
vi ~/.zshrc

i #insert mode & add below;
[[ -d ~/.rbenv ]] && \
export PATH=${HOME}/.rbenv/bin:${PATH} && \
eval "$(rbenv init -)"

esc #leave insert mode
:wq # save and quit

source ~/.zshrc
gem install bundler
gem install jekyll

공백 없애고 나니 성공적으로 에러 해결 및 bundler, jekyll 설치.

이렇게 보니 루비랑 파이썬이랑 정말 닮았다. ruby~python, rbenv~pipenv, gem~pip

cd desktop # 바탕화면으로 이동
jekyll new gitblog # gitblog 디렉토리로 jekyll 프로젝트 생성

'''
github에서 'username.github.io' repository 생성 (따옴표 적지 않아요!)
'''

cd gitblog # 프로젝트 디렉토리로 이동
git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/hughqlee/hughqlee.github.io.git
git push -u origin main

잠시후...

jekyll 프로젝트 초기화면

deploy를 따로 설정할 필요없이 레퍼지토리 이름이 username.github.io면 블로그가 알아서 열리는 게 신기하다..

728x90
반응형