Skip to content

Latest commit

 

History

History
93 lines (67 loc) · 3.56 KB

linux.md

File metadata and controls

93 lines (67 loc) · 3.56 KB

Notes on Linux installation

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.

  1. Install Ruby 2.5.1
  2. Fork the http://github.com/AgileVentures/LocalSupport repo (fork button at top right of github web interface)
  3. Clone the new forked repo onto your dev machine
  4. cd LocalSupport
  5. 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
  1. Install postgreSQL - see PostgreSQL install instructions below

  2. Install X virtual frame buffer

    sudo apt-get install xvfb

  3. git checkout develop

  4. Run bundle install to get the gems

  5. Run npm install to get the javascript dependencies

  6. 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

Run locally

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.

Run tests

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