New contributor guide - Growstuff/growstuff GitHub Wiki
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
- Sign up on Github
- Set up Git
- 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
- Install PostgreSQL
Ruby
- Install rvm
- Use rvm to install Ruby. In a terminal, go to your growstuff directory and run
rvm install $(< .ruby-version) - Create a Ruby gemset. This holds the packages you need for growstuff separate from everything else. Run
rvm gemset create $(< .ruby-gemset) - Install Bundler:
gem install bundler - 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
- Run
bundle installto install all the remaining dependencies. - Copy the example configuration file
config/application.yml.exampletoconfig/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. - Create your test database:
RAILS_ENV=development rake db:create - 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.