The App for Community - https://info.gather.coop
Gather is a Ruby on Rails application with some client-side JavaScript for dynamic view elements. HTML is generally rendered server-side. SCSS is used for styling. No special IDE is required for Ruby on Rails development.
Ruby on Rails applications are best developed and run on Linux, Unix, or Mac OS. Development is also possible, though not recommended, on Windows. See the Rails download page for more information.
To install the software below we recommend the following package managers:
For both production and development environments:
gem install bundler
to install.npm install -g yarn
)gem install mailcatcher
to install).
Follow these steps to setup a development environment for Gather.
jvm.options
file. See here for instructions.Retrieve project files using Git git clone https://github.com/gather-community/gather.git cd gather
If developing, it's best to work off the development branch:
git checkout develop
The remaining steps should all be done from the project directory.
bundle install
to install the required gems.config/settings.local.yml.example
to config/settings.local.yml
.config/settings.local.yml
to fit your environment. Be sure to read all the comments within that file for guidance.config/database.yml.example
to config/database.yml
.rake db:create
to create gather_development
and gather_test
databases.rake db:schema:load
to create the schema in both databases.settings.local.yml
.bundle exec rspec
.brew services start redis
.sudo systemctl start redis
or sudo service redis start
.sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain config/ssl/gatherdev.org.crt
.bin/dev
.bin/delayed_job run
.https://gatherdev.org:3000
to start Gather.Later, to re-start your development environment, the following should be sufficient:
bundle install
bundle exec rake db:migrate
brew services start redis
And if working with Mailman, in a separate terminal:
cd ../mailman
source venv/bin/activate
mailman start
cd mailman-suite/mailman-suite_project/
python3 manage.py runserver
Caching is off by default in development mode since it can lead to confusing issues where changes to views don't show up.
If you are testing some caching behavior you can enable it temporarily by doing:
CACHE=1 rails server
Linters are strongly recommended for checking your code. The CI system will run linters as well and pull requests won't be approved until all issues are resolved or cancelled by the reviewer. We recommend eslint, rubocop, and scss_lint.
If the Elasticsearch index is returning 403 errors, try the following to reset the index (assumes development environment is where the problem is ocurring):
rails console -e development
Work::Shift.__elasticsearch__.create_index!(force: true)
After re-creating the search index in development mode, if you want to be able to search existing data, you'll need to re-populate the index:
ActsAsTenant.current_tenant = Cluster.find(...)
Work::Shift.find_each { |s| s.__elasticsearch__.index_document }
Most code editors have plugins for linting. They will identify and let you click directly into problematic lines. You are encouraged to try one out!