Git - Ruby Setting

Sunbae leeΒ·2021λ…„ 5μ›” 28일
1

Git

λͺ©λ‘ 보기
2/2
post-thumbnail

🐢 Ruby μ„€μΉ˜ 및 ν™˜κ²½ μ„€μ •






🦁 Ruby μ„€μΉ˜



ㆍ Click : Ruby Install

Ruby μ„€μΉ˜ 이유 :
동적 객체 μ§€ν–₯ 슀크립트 ν”„λ‘œκ·Έλž˜λ° 언어인 Ruby둜 μž‘μ„±λ˜μ—ˆκΈ° λ•Œλ¬Έμ—
둜컬 개발 ν™˜κ²½ μ„ΈνŒ…μ„ μœ„ν•΄μ„œλŠ” Rubby μ„€μΉ˜κ°€ ν•„μš”ν•©λ‹ˆλ‹€.


μ €λŠ” Ruby+Devkit 3.0 1-1 (x64) λ₯Ό λ‹€μš΄ λ°›μ•˜μŠ΅λ‹ˆλ‹€.

λ‹€λ₯Έ 버전은 였λ₯˜κ°€λ‚˜μ„œ Ruby+Devkit 2.5.7-1 (x64) 둜 μ„€μΉ˜ ν•©λ‹ˆλ‹€.

Rubyλ₯Ό μ„€μΉ˜ μ™„λ£Œ ν•˜λ©΄ μ΄λ ‡κ²Œ 화면이 λœ¨λŠ” κ±Έ 확인 ν•©λ‹ˆλ‹€.

Gemfile이 μžˆλŠ” κ²½λ‘œμ—μ„œ λͺ…λ Ήμ–΄λ₯Ό μ‹€ν–‰ν•˜κΈ° μœ„ν•΄

file이 μžˆλŠ” κ²½λ‘œμ—μ„œ cmd라고 검색을 ν•©λ‹ˆλ‹€.

gem install bundler
bundle
jekyll serve









🦁 Ruby μ œλŒ€λ‘œ μ„€μΉ˜ λ˜μ—ˆλŠ”μ§€ 확인



이미지와 같이 λͺ…λ Ήμ–΄κ°€ 잘 싀행이 되면

인터넷 μ£Όμ†Œ 창에 http://localhost:4000/ λ₯Ό μž…λ ₯ν•˜λ©΄ μ•„λž˜μ™€ 같이 sample μ‚¬μ΄νŠΈκ°€ λ³΄μ—¬μ§‘λ‹ˆλ‹€.


μ΅œμ’… push ν•˜κΈ° μ „ μž‘μ—…

λΆˆν•„μš”ν•œ νŒŒμΌμ„ μ •λ¦¬ν•˜λŠ” μž‘μ—…μ„ ν•©λ‹ˆλ‹€.

.github
test
.editorconfig
.gitattributes
.travis.yml
CHANGELOG.md
docs(μƒ˜ν”Œ νŒŒμΌλ“€μ΄ λ“€μ–΄κ°€ μžˆλŠ” 폴더)

μ €λŠ” ν΄λ”μ—μ„œ 직접 μ§€μ› μŠ΅λ‹ˆλ‹€.


🦁 폴더에 μ—…λ‘œλ“œ 된 λ‚΄μš© PUSH


pushλ₯Ό ν•΄λ³΄κ² μŠ΅λ‹ˆλ‹€.

git add --all
git commit -m "First Upload"
git push -u origin main 

Trouble Shooting

  • μ•„λž˜μ™€ 같은 였λ₯˜κ°€ λ°œμƒν•˜λŠ” 경우 해결법을 μ‹€ν–‰ ν›„ λ‹€μ‹œ push
tnsqo@DESKTOP-FK3U9VS MINGW64 /c/sun/sunbae_blog (main)
$ git push -u origin main
To https://github.com/SsunLee/ssunlee.github.io.git
 ! [rejected]        main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/SsunLee/ssunlee.github.io.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  • 해결법 : git pull origin 브런치λͺ… --allow-unrelated-histories
tnsqo@DESKTOP-FK3U9VS MINGW64 /c/sun/sunbae_blog (main)
$ git pull origin main  --allow-unrelated-histories
From https://github.com/SsunLee/ssunlee.github.io
 * branch            main       -> FETCH_HEAD
CONFLICT (add/add): Merge conflict in README.md
Auto-merging README.md
Automatic merge failed; fix conflicts and then commit the result.


PUSH κ°€ μ œλŒ€λ‘œ λ˜μ—ˆλ‹€λ©΄ λ‚΄ github μ£Όμ†Œμ— 접속할 λ•Œλ„ λ™μΌν•˜κ²Œ
ν‘œμ‹œλ˜λŠ” 것을 확인 ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

🦁 Ruby Server 싀행방법


gem install bundler
bundle
jekyll serve

λ˜λŠ”

bundle exec jekyll serve

λΈ”λ‘œκ·Έ κ²Œμ‹œλ¬Ό μž‘μ„±μ€ 넀이밍 룰에 맞게
YEAR-MONTH-DAY-title.md 라고 ν•©λ‹ˆλ‹€.
양식에 맞게 .md νŒŒμΌμ„ μƒμ„±ν•˜λ©΄ μžλ™μœΌλ‘œ λœ¨λŠ”μ§€ 보아야 κ² μŠ΅λ‹ˆλ‹€.

profile
QA Engineer

0개의 λŒ“κΈ€