고객사 가이드
레일스 프로젝트 소스 공유 및 서버 실행
소스코드 공유
소스코드를 공유해드리는 방법은 아래 두 가지로 나뉩니다
- 소스를 압축해서 전달 - 이후에 인썸니아가 유지보수를 하지 않는 경우
- github 소스코드 프로젝트에 collaborator(협력자)로 초대 - 인썸니아가 유지보수를 하는 경우
코드 내려받기
협업자로 초대해드린 github 저장소에서 프로젝트 소스를 clone 받습니다
git clone https://github.com/insomenia/[프로젝트이름].git
준비사항
ruby 2.6.5 버젼(또는 Gemfile에 명시된 루비 버젼)이 설치되어 있어야 합니다.
https://gorails.com/setup/osx/10.15-catalina 참고
homebrew, rbenv, ruby, rails, postgresql 순서로 설치
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install rbenv ruby-build
# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
# Install Ruby
rbenv install 2.6.5
rbenv global 2.6.5
ruby -v
git config --global color.ui true
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR@EMAIL.com"
ssh-keygen -t rsa -C "YOUR@EMAIL.com"
cat ~/.ssh/id_rsa.pub
ssh -T git@github.com
gem install rails -v 6.0.3.4
rbenv rehash
brew install postgresql
Once this command is finished, it gives you a couple commands to run. Follow the instructions and run them:
# To have launchd start postgresql at login:
brew services start postgresql
프로젝트 서버 실행
cd [프로젝트 경로]
bundle
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake db:seed
rails s
코드 수정 후 서버에 반영
git commit -a -m "수정 사항"
git push origin master
# 실서버 배포 코드
bundle exec cap production deploy