Skip to content

New contributor guide

Mackenzie edited this page Oct 12, 2023 · 13 revisions

To start contributing to Growstuff, you'll need to get the code and get a Ruby development environment setup. Here's how.

Get the code

  1. Sign up on Github
  2. Set up Git
  3. Click the "Fork" button above to fork this repo

Codespaces

The easiest way to get hacking is to start a new codespace.

Once the container is built, start your application and login

Local Development from scratch

Database

  1. Install PostgreSQL

Ruby

  1. Install rvm
  2. Use rvm to install Ruby. In a terminal, go to your growstuff directory and run rvm install $(< .ruby-version)
  3. Create a Ruby gemset. This holds the packages you need for growstuff separate from everything else. Run rvm gemset create $(< .ruby-gemset)
  4. Install Bundler: gem install bundler
  5. Install the gems: bundle install

Mac OS notes

You'll need to brew install shared-mime-info before running bundle install

Install elastic search

Ubuntu linux instruction: https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html

Install Chrome browser

This is used (headless) when running the tests/specs

Install Growstuff

If you're using Mac OS X and installed PostgreSQL using Postgres.app, run this:

gem install pg -v '0.19.0' -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config
  1. Run bundle install to install all the remaining dependencies.
  2. Copy the example configuration file config/application.yml.example to config/application.yml. This file contains API tokens and other secrets which vary from developer to developer, so we can't keep it in version control.
  3. Create your test database: RAILS_ENV=development rake db:create
  4. Setup your test database: RAILS_ENV=development rake db:setup

Test it

If you run bundle exec rspec it should run all the tests and have no failures. Yay!

You can also run rails server then go to http://localhost:3000 in your web browser to try it out.