Skip to content
Rick Zhang edited this page Sep 20, 2020 · 21 revisions

First Time Setup & Dependencies

Install docker
Install rbenv
Install the right version of ruby with rbenv (2.5.6)

rbenv init #restart your terminal after this command
rbenv install 2.5.6
rbenv global 2.5.6
rbenv rehash
git clone https://github.com/asuc-octo/Beehive.git
git clone https://github.com/asuc-octo/beehive-secrets
cp beehive-secrets/.env Beehive/
cp beehive-secrets/database.yml Beehive/config/
cp beehive-secrets/Dockerrun.aws.json Beehive/

#Certs
cp beehive-secrets/certs/beehive.berkeley.edu.crt Beehive/config/apache2/fullchain.pem
cp beehive-secrets/certs/beehive.berkeley.edu.key Beehive/config/apache2/privkey.pem

gem install bundler
brew install libpqxx
brew install postgres
cd Beehive
bundle // re-run whenever you add or remove gems from the Gemfile

Certificates

You may need to further set up SSL certificates on your system.

Mac

Spotlight Search > "Keychain Access" > File > Import Items > beehive-secrets/myCA.pem

Afterwards, search beehive.berkeley.edu in Keychain Access > Double Click > When using this certificate > Always Trust

For further information, refer to the troubleshooting wiki page.

Running the Server

Locally this can take 1 of 2 forms.
Method 1: Spinning up the Docker container

cd Beehive
docker-compose up --build
sudo vim /etc/hosts
add “127.0.0.1 beehive.berkeley.edu” to the end of /etc/hosts

Method 2: Running Puma, the local app server.

cd Beehive
rails serve // or rails s

The second method is sufficient most of the time, but the first one is very helpful if you would like to emulate the production environment.

Some quick git commands:

git pull
git push origin [branch-name]
git remote -v // view all remote locations/repos
git branch // view branches and which one you’re on
git checkout [branch-name] // go to branch-name
Clone this wiki locally