In order to work on LocalSupport, please fork and clone the project.
If you need to setup your development environment then gorails has an excellent walkthrough.
- Install Ruby 2.5.1
- Fork the http://github.com/AgileVentures/LocalSupport repo (fork button at top right of github web interface)
- Clone the new forked repo onto your dev machine
cd LocalSupport
- Install GNU IDN Library version 1.33 You will need a few basic tools, such as ‘sh’, ‘make’ and ‘cc’.
wget -q ftp://ftp.gnu.org/gnu/libidn/libidn-1.33.tar.gz
tar xfz libidn-1.33.tar.gz
cd libidn-1.33/
./configure
...
make
...
make install
...
cd ../../
rm libidn-1.33.tar.gz
The make install
command may need to be ran with sudo. for ex:
sudo make install
-
Install postgreSQL - see PostgreSQL install instructions below
-
Install X virtual frame buffer
sudo apt-get install xvfb
-
git checkout develop
-
Run
bundle install
to get the gems -
Run
npm install
to get the javascript dependencies -
Run the following to get the database set up and import seed data (Note:
db:setup
is a custom task that invokes all required import and seeds. )bundle exec rake db:create bundle exec rake db:migrate bundle exec rake db:setup
Note: You might encounter error with the creating the relevant schema. This is due to some configuration error with PostgreSql. Solution of interest can be found (1) here and (2) here. You should first drop the cluster as mentioned in (1) and then configure the user access privileges in pg_hba.conf and username mapping in pg_ident.conf. One way to successfully configure the line pg_hba.conf
from
# TYPE DATABASE USER ADDRESS METHOD
local all all peer
to
# TYPE DATABASE USER ADDRESS METHOD
local all all trust
If you hit problems, review issues below, and ask us on Slack chat.
[Note that rvm can be extremely helpful for managing ruby versions. Installing rvm on Ubuntu]
Debian 7 users can follow these instructions to launch Xvfb as daemon : Xvfb-on-Debian-7
and then in principle you can run rails server and see that app running locally.
The db/seeds.rb task that you ran added some organizations and a test user that you can experiment with. Read that file for more information.
Also you should run the specs and cucumber features to make sure your installation is solid.
Before running the tests you should create a file named config/application.yml
and add the following line:
DOIT_HOST: 'http://api.qa2.do-it.org/v2'
For confidence, you shall prepare the test database first by running
rake db:test:prepare
, then run tests using following commands:
bundle exec rake spec
bundle exec rake cucumber
and then when you start any BDD or TDD ensure autotest is running in the background:
bundle exec rake autotest