Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Initial setup: Mac

Zachary Wood edited this page Jan 29, 2020 · 2 revisions

Schedules setup - Mac

If you haven't already, please follow the SRCT initial setup instructions for Mac to install the prerequisite software.

Open Terminal and navigate to your SRCT projects directory.

1. Install Ruby

We will use a tool called rbenv to install Ruby. This is good practice as it allows you to easily manage multiple Ruby versions across different projects. Run

brew install rbenv ruby-build

To activate rbenv, run the command

rbenv init

and follow the instructions that come up. Depending on the shell you use, it will ask you to insert some code at the end of your shell configuration.

And then install Ruby 2.6.5 with

rbenv install 2.6.5
rbenv global 2.6.5

And run ruby -v to ensure the version is correct.

2. Install Bundler

Bundler is the ruby program used to install ruby packages. To install it, simply run

gem install bundler

3. Clone Schedules

In your SRCT projects directory, run the following command to clone the Schedules codebase to your machine

git clone git@github.com:srct/schedules.git

Run cd schedules/schedules to enter into the project directory.

4. Install dependencies

To install the Ruby dependencies, run

bundle install

This will probably fail -- if it does, run rm Gemfile.lock and try again.

Next, to install the JavaScript dependencies, run

yarn install

If this fails, run rm yarn.lock and try again.

5. Setup database

In your terminal, start the MySQL server and run mysql -uroot -p and then type root and enter to login to MySQL. Run the following commands to create the development and test databases for Schedules:

CREATE DATABASE schedules_dev;
CREATE DATABASE schedules_test;

Next, run the following commands to load the database with the last semester's data:

rails db:migrate
rails runner db/seeds.rb update

6. Run Schedules!

Finally, run this to start the Schedules development server:

rails s

Navigate in your web browser to localhost:3000 to see Schedules in action!