본문 바로가기
  • Veritas vos liberabit
Coding/React

큐뱃 개발 - heroku 업로드

by Rouxist 2022. 8. 1.

heroku로 업로드함

 

일단 homebrew가 안되길래 이걸 까는 것부터 시작

https://designdepot.tistory.com/209

 

M1칩 Mac에서 Homebrew 설치방법

M1칩을 탑재한 새로운 맥(Big Sur)에서 Homebrew를 설치하려면 /bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/nrubin29/bea5aa83e8dfa91370fe83b62dad6dfa/raw/48f48f7fef21abb308e129a80b3214c..

designdepot.tistory.com

 

공홈에 따르면

brew install heroku/brew/heroku

로 설치 가능.

이후 $heroku --version 으로 잘 설치됐는지 확인 후,

$heroku login하면 로그인이 가능했다.

$heroku create 이름 으로는 프로젝트 생성 가능

 

 

https://www.youtube.com/watch?v=5PaUiPyBDJY 

여기있는대로 파일들 셋업을 하고

-포트 넘버 process.env.port 추가하기

-몽구스 그 시리얼도 process.env로

-process.env.NODE_ENV

 

 

 

git add .
git commit -m "example"
heroku login

$ heroku create

git push heroku main

순서대로. heroku login 안해주면 안되더라.

 

 

https://www.mongodb.com/developer/products/atlas/use-atlas-on-heroku/

config vars에서 URI를 추가하는데, 이 때는 Atlas에서 Connect를 누르고 나오는 URI를 넣어야 했다. (server.js에서 mongoose.connect 할 때 넣는 URI말고)

아 그리고 mongodb에서 0.0.0.0 추가도 함

 

 

그리고 마지막에 push할 때 에러가 났는데.. 

error: src refspec main does not match any 라고 업로드할 게 없다는 에러

https://stackoverflow.com/questions/26595874/heroku-src-refspec-master-does-not-match-any

 

heroku: src refspec master does not match any

I'm hosting on Heroku. When I push: git push master Heroku I get the error: error: src refspec master does not match any. error: failed to push some refs to 'git@heroku.com: etc ...'

stackoverflow.com

이걸로 해결

 

그리고 유사하게 -f 붙여서 강제로 올리는 것도.

https://wikim.tistory.com/201

 

깃허브, failed to push some refs to~,Updates were rejected because the remote contains work that you do not have locally 에

깃허브, failed to push some refs to~,Updates were rejected because the remote contains work that you do not have locally 에러 깃허브에 로컬 프로젝트를 push해주려는 도 중 아래와 같은 에러가 발생했다...

wikim.tistory.com

유사하게, npm install에도 force가 있음

https://stackoverflow.com/questions/71671541/npm-install-react-google-login-not-working

 

 

 

https://alreadyusedadress.tistory.com/51

 

'heroku' does not appear to be a git repository

git push heroku master 시에 발생하는 오류 fatal: 'heroku' does not appear to be a git repository fatal: Could not read from remote repository. heroku git:remote -a [앱이름] 해주면 된다

alreadyusedadress.tistory.com

이것도 참고

 

 

 

 

8/19 업데이트

Deploy탭에 다 너무 잘 나와있다..

'Coding > React' 카테고리의 다른 글

큐뱃 개발 - 2022.08.02  (0) 2022.08.04
MongoDB  (0) 2022.08.02
큐뱃 개발 - 구글 로그인 (2022.07.28~29)  (0) 2022.07.30
큐뱃 개발 - MongoDB 관련  (0) 2022.07.25
타이머 개발 12일차, 13일차  (0) 2022.07.07