This is the API service for Bid Bros
-
Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
Install RVM
\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.2.2
rvm use 2.2.2 --default
rvm gemset create bidbros
rvm use 2.2.2@bidbros --default
-
Install Postgres
brew install postgresql
- Follow the below post install steps for postgres:
- To have launchd start postgres at login:
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
- Then to load postgres now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
- To have launchd start postgres at login:
-
Change the username in
config/db.yml
to your username -
gem install bundler
-
bundle install
-
Create the Postgres databases
bundle exec rake db:create
bundle exec rake db:create RACK_ENV=test
-
Run the database migrations
bundle exec rake db:migrate
bundle exec rake db:migrate RACK_ENV=test
bundle exec rackup
- This will start the server on port 9292 by default
bundle exec rake console