<commit_before>= Installation for developers on Debian 8 (Jessie)

This a short explanation on installation steps for developers.

== 1. Dependencies

Before all, install all distribution dependencies:

    sudo apt-get install imagemagick graphicsmagick tesseract-ocr tesseract-ocr-ara tesseract-ocr-jpn tesseract-ocr-fra tesseract-ocr-eng tesseract-ocr-spa pdftk libreoffice poppler-utils poppler-data ghostscript openjdk-7-jdk libicu52 redis-server postgresql-9.4-postgis-2.1 libcurl4-openssl-dev openjdk-7-jdk libgeos-dev libgeos++-dev libproj-dev libpq-dev libxml2-dev  libxslt1-dev zlib1g-dev libicu-dev


== 2. Ruby

Install Ruby 2.2.3. If your distribution isn't up-to-date, you need to install {rbenv}[https://github.com/sstephenson/rbenv] to install the good version ({RVM}[https://rvm.io] can be used if you prefer):

* {Installation of rbenv}[https://github.com/sstephenson/rbenv#installation]
* {Installation of ruby-build}[https://github.com/sstephenson/ruby-build#installation] which permit to download and compile ruby compiler for rbenv
* Install ruby 2.2.3:
    rbenv install 2.2.3
* Set this compiler as the default:
    rbenv global 2.2.3

== 3. Configure Database

* Copy the +config/database.yml.sample+ into +config/database.yml+.

* Create a PostgreSQL superuser for Ekylibre
    sudo createuser -s -P ekylibre

* Update your +database.yml+ in +config/+ with your informations like in this example:

    default: &default
      adapter: postgis
      encoding: unicode
      pool: 5
      postgis_extension: []
      schema_search_path: public,postgis
      username: ekylibre
      password: <PASSWORD>
      host: 127.0.0.1

    development:
      <<: *default
      database: ekylibre_development

  If you haven't customized PostgreSQL configuration, you must set +host+ parameter to 127.0.0.1

== 4. Configure ruby dependencies

* Install bundler with rubygems:
    gem install bundler

* Move to Ekylibre directory root and install gems with bundler:
    cd /path/to/ekylibre
    JAVA_HOME=/usr/lib/jvm/java-7-openjdk NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install

  Or you can add the following lines in your +~/.bash_profile+ in your home directory and run +bundle install+ after:

    export JAVA_HOME=/usr/lib/jvm/java-7-openjdk
    export NOKOGIRI_USE_SYSTEM_LIBRARIES=1

The last operation could take time.

== 5. Initialize database

* Create and migrate database:
    rake db:create db:migrate

See {rails guide}[http://guides.rubyonrails.org/active_record_migrations.html#running-migrations] for more informations on migrations.

== 6. Create an empty farm

* Execute command:
    rake tenant:init TENANT=my-little-farm

* Add in +/etc/hosts+ a line to configure an artificial subdomain corresponding to your instance:
     127.0.0.1 my-little-farm.ekylibre.lan

* Launch server:
    foreman start
<commit_msg>Adds missing source step in Debian 8 Install guide<commit_after>= Installation for developers on Debian 8 (Jessie)

This a short explanation on installation steps for developers.

== 1. Dependencies

Before all, install all distribution dependencies:

    sudo apt-get install imagemagick graphicsmagick tesseract-ocr tesseract-ocr-ara tesseract-ocr-jpn tesseract-ocr-fra tesseract-ocr-eng tesseract-ocr-spa pdftk libreoffice poppler-utils poppler-data ghostscript openjdk-7-jdk libicu52 redis-server postgresql-9.4-postgis-2.1 libcurl4-openssl-dev openjdk-7-jdk libgeos-dev libgeos++-dev libproj-dev libpq-dev libxml2-dev  libxslt1-dev zlib1g-dev libicu-dev

== 2. Ruby

Install Ruby 2.2.3. If your distribution isn't up-to-date, you need to install {rbenv}[https://github.com/sstephenson/rbenv] to install the good version ({RVM}[https://rvm.io] can be used if you prefer):

* {Installation of rbenv}[https://github.com/sstephenson/rbenv#installation]
* {Installation of ruby-build}[https://github.com/sstephenson/ruby-build#installation] which permit to download and compile ruby compiler for rbenv
* Install ruby 2.2.3:
    rbenv install 2.2.3
* Set this compiler as the default:
    rbenv global 2.2.3

== 3. Get sources

* Clone sources from repository
    git clone https://github.com/ekylibre/ekylibre.git /path/to/ekylibre

== 4. Configure Database

* Go at sources root:
    cd /path/to/ekylibre

* Copy +config/database.yml.sample+ into +config/database.yml+.

* Create a PostgreSQL superuser for Ekylibre
    sudo createuser -s -P ekylibre

* Update your +database.yml+ in +config/+ with your informations like in this example:

    default: &default
      adapter: postgis
      encoding: unicode
      pool: 5
      postgis_extension: []
      schema_search_path: public,postgis
      username: ekylibre
      password: <PASSWORD>
      host: 127.0.0.1

    development:
      <<: *default
      database: ekylibre_development

  If you haven't customized PostgreSQL configuration, you must set +host+ parameter to 127.0.0.1

== 5. Configure ruby dependencies

* Install bundler with rubygems:
    gem install bundler

* Move to Ekylibre directory root and install gems with bundler:
    cd /path/to/ekylibre
    JAVA_HOME=/usr/lib/jvm/java-7-openjdk NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install

  Or you can add the following lines in your +~/.bash_profile+ in your home directory and run +bundle install+ after:

    export JAVA_HOME=/usr/lib/jvm/java-7-openjdk
    export NOKOGIRI_USE_SYSTEM_LIBRARIES=1

The last operation could take time.

== 6. Initialize database

* Create and migrate database:
    rake db:create db:migrate

See {rails guide}[http://guides.rubyonrails.org/active_record_migrations.html#running-migrations] for more informations on migrations.

== 7. Create an empty farm

* Execute command:
    rake tenant:init TENANT=my-little-farm

* Add in +/etc/hosts+ a line to configure an artificial subdomain corresponding to your instance:
     127.0.0.1 my-little-farm.ekylibre.lan

== 8. Try it

* Launch server:
    foreman start

{'fraction_non_alphanumeric': 0.08852846764656191, 'fraction_numerical': 0.01875316776482514, 'mean_word_length': 3.8484848484848486, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1549158', 'n_tokens_mistral': 2066, 'n_tokens_neox': 1938, 'n_words': 591}