Skip to content

Latest commit

 

History

History
152 lines (119 loc) · 5.44 KB

INSTALL.md

File metadata and controls

152 lines (119 loc) · 5.44 KB

Chouette2 External Dependencies

Install the Chouette IEV 3.X Web Service see how to

The next steps assume that :

  • a Chouette IEV Web Service is running (on localhost, port 8080)
  • a Postgres database exists (chouette2 on localhost, port 5432) with a postgres user (chouette, with password chouette)

On Debian/Ubuntu/Kubuntu OS : assumes that the depot contains the correct version

sudo apt-get install libpq-dev git unzip libgeos-dev proj-bin libproj-dev make

On OSX : assumes that the depot contains the correct version

brew install libffi geos proj

If your Linux distribution doesn't publish an RVM package, install RVM from sources

Install ruby 2.1.x

rvm install ruby-2.1.x
rvm --default use 2.1.x

Install bundler 1.10.x

gem install bundler -v 1.10.x

Chouette2 Installation

On Debian, chouette can also be installed as a package : see debian packages

Install web application

Get git source code :

cd
git clone -b V3_2 git://github.com/afimb/chouette2
cd chouette2

Download gem librairies

bundle install

Chouette2 application config file

Copy and fill application.yml

cp config/application.example.yml config/application.yml
  1. Configure domain_name with your domain, for example: domain_name: chouette.mobi See Action Mailer Configuration documentation
  2. Configure SMTP settings with all lines started with smtp_ For using SMTP you must set 'smtp' in smtp_delivery_method See Action Mailer Configuration documentation
  3. Fill secret_key_base and devise_secret_key by executing rake secret in your terminal See Rails documentation
  4. Configure the Chouette IEV Web Service url api_endpoint
  5. Configure the Google Analytics Key google_analytics_tracker See Google Analytics
  6. Configure the IGN Géoportail Key geoportail_api_key See API Géoportail documentation
  7. Configure OSRM Backend URL osrm_endpoint See Project-OSRM
  8. If you want to enable Google oauth2 authentification google_client_id and google_secret_id See Google Oauth2
  9. If you want to enable Facebook oauth2 authentification facebook_client_id and facebook_secret_id See Facebook Oauth2

Chouette2 database configuration

Add the PostGIS extension to your database

RAILS_ENV=production bundle exec rake db:gis:setup

Update the database schema

RAILS_ENV=production bundle exec rake db:migrate

Prepare the static resources (assets)

RAILS_ENV=production bundle exec rake assets:clobber assets:precompile

Chouette2 others configuration

Configure asset access (Must be True if you use Webrick, or False if you use Apache or Nginx).

Configure the way Chouette2 sends e-mail.

Run Chouette2

Launch the task if you want to send mail asynchronously (See previous section to de-activate it)

RAILS_ENV=production bundle exec rake jobs:work

This task may be added in the system start-up configuration

Launch the Rails server with WEBrick ( default RoR web server, note: Webrick runs on default port 3000)

RAILS_ENV=production bundle exec rails server

This task may be added in the system start-up configuration. Instead of using WEBrick, the Rails application may be deployed on Phusion Passenger with an Apache or NGinx front-end, to make server faster and more robust.

Apache like NGinx can serve static resources, so change parameter serve_static_assets to false in production.rb

Problems related to proj4

If you run into problems related to libProj library, you can try building it from source.

Chouette depends on an older version of libProj. Newer versions that are pre-installed on Linux/MacOS exposes a different API. The last version of libProj that exposes both the old and new API is 7.2

Download https://download.osgeo.org/proj/proj-7.2.1.tar.gz and then follow instructions from https://proj.org/install.html#compilation-and-installation-from-source-code.

The first 3 build steps are sufficient.

Then launch Chouette2 with the PROJ4_LIBRARY_PATH env variable.

RAILS_ENV=development PROJ4_LIBRARY_PATH=/<path>/proj-7.2.1/build/lib bundle exec rails server

Test Chouette2

bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake spec