This project has been ported over to another repository for maintenance. As a result, this repo will be archived and made read-only.
Welcome! This document details the setting up of a development environment. The project uses the following frameworks:
-
Install a package manager (OS X)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew update
With mac no longer support running brew as root. You may find errors or warnings that you can't do X because of permissions of folders not being writable. To solve this type:
brew doctor
It should shoot out warnings and things to fix - the stuff you want to focus on is the Warning:
Warning: The following directories are not writable: /usr/local/{some directory} Warning: You have unlinked kegs in your Cellar ... {some lib} etc.
You'll probably need to run for all of the directories:
sudo chown -R $(whoami) /usr/local/{some directory}
and missing links:
brew link {some lib}
-
Install rbenv and ruby-build
rvm is incompatiable with rbenv. Keep using rvm if it works for you.
brew install rbenv brew install ruby-build rbenv init rbenv install -l rbenv install 2.3.7
if rbenv fails you may need to run the following command first before rbenv install: xcode-select --install # possibly need xcode first as well
-
Install ImageMagick
For Mac: Run the brew command:
brew install imagemagick --build-from-source
-
Install Postgres
brew install postgresql
-
Clone the project
cd into the location you would like to clone the project to
run this command on terminal:
git clone https://github.com/GovTechSG/product-review-platform
ask any existing project team members for 'application.yml' and put it in the config folder
-
Configure the project
cd into the root directory of the project
ENSURE YOU HAVE THE APPLICATION YML FILE IN THE CONFIG
run these command on terminal:
gem install bundler bundle install rails db:drop rails db:create rails db:schema:load rails db:seed
-
Test run
In the project root directory..
Test if the project is setup properly:
rails s
open http://localhost:3000/ on your browser. you should see a landing page.
Test if project is working:
rspec rubocop
these should not give any errors (warnings are fine).
Ruby: 2.3.7
Rails: 5.2.0
Database: Postgresql 10