<commit_before># Introduction

This document will give you steps to install LinuxFr.org website on your
Debian Stretch development machine.

Note that all commands which require root access are prefixed by `sudo`.

# Use stretch-backports

LinuxFr.org requires to add `stretch-backports` source package as it
needs the `npm`package.

```
~ $ sudo bash -c "echo 'deb http://deb.debian.org/debian stretch-backports main' >> /etc/apt/sources.list.d/linuxfr.list"
~ $ sudo apt update
```

# Install Debian packages

Packages to install from main Stretch source:

```
~ $ sudo apt install mysql-server mysql-client libmysql++-dev git \
build-essential openssl libreadline-dev curl libcurl4-openssl-dev zlib1g \
zlib1g-dev libssl-dev libxml2-dev libxslt-dev autoconf libgmp-dev libyaml-dev \
ncurses-dev bison automake libtool imagemagick libc6-dev hunspell \
hunspell-fr-comprehensive redis-server ruby ruby-dev ruby-rack
```

Note:
  * you can use libcurl4-gnutls-dev instead of libcurl4-openssl-dev.
  * the `mysql` packages will install MariaDB on Debian Stretch

Packages to install from backports:

```
~ $ sudo apt install -t stretch-backports nodejs npm
```

# Get LinuxFr.org code and external resources

Use git to get LinuxFr.org sources:

```
~ $ git clone git://github.com/linuxfrorg/linuxfr.org.git
```

To be able to reach ruby external resources, you need the `bundler` packager.
The minimal required version is written at the end of the `Gemfile.lock` file.
Actually, Debian has the `1.13.6` version and the lock file requires already
the `1.16.4` version.

So we first install the `bundler` packager directly from `rubygems.org`:

```
~ $ gem install --user-install bundler
```

Don't forget to update your PATH environment according to the warning message
shown during installation.

Now, we can reach external Ruby resources:

```
~ $ cd linuxfr.org
~/linuxfr.org $ bundle install --path vendor/bundle
~/linuxfr.org $ bundle check
```

The `check` command above should say you there's no problem.

LinuxFr.org uses also some nodejs resources:

```
~/linuxfr.org $ npm install
```<commit_msg>INSTALL.md: use bundle config to set path before install<commit_after># Introduction

This document will give you steps to install LinuxFr.org website on your
Debian Stretch development machine.

Note that all commands which require root access are prefixed by `sudo`.

# Use stretch-backports

LinuxFr.org requires to add `stretch-backports` source package as it
needs the `npm`package.

```
~ $ sudo bash -c "echo 'deb http://deb.debian.org/debian stretch-backports main' >> /etc/apt/sources.list.d/linuxfr.list"
~ $ sudo apt update
```

# Install Debian packages

Packages to install from main Stretch source:

```
~ $ sudo apt install mysql-server mysql-client libmysql++-dev git \
build-essential openssl libreadline-dev curl libcurl4-openssl-dev zlib1g \
zlib1g-dev libssl-dev libxml2-dev libxslt-dev autoconf libgmp-dev libyaml-dev \
ncurses-dev bison automake libtool imagemagick libc6-dev hunspell \
hunspell-fr-comprehensive redis-server ruby ruby-dev ruby-rack
```

Note:
  * you can use libcurl4-gnutls-dev instead of libcurl4-openssl-dev.
  * the `mysql` packages will install MariaDB on Debian Stretch

Packages to install from backports:

```
~ $ sudo apt install -t stretch-backports nodejs npm
```

# Get LinuxFr.org code and external resources

Use git to get LinuxFr.org sources:

```
~ $ git clone git://github.com/linuxfrorg/linuxfr.org.git
```

To be able to reach ruby external resources, you need the `bundler` packager.
The minimal required version is written at the end of the `Gemfile.lock` file.
Actually, Debian has the `1.13.6` version and the lock file requires already
the `1.16.4` version.

So we first install the `bundler` packager directly from `rubygems.org`:

```
~ $ gem install --user-install bundler
```

Don't forget to update your PATH environment according to the warning message
shown during installation.

Now, we can reach external Ruby resources:

```
~ $ cd linuxfr.org
~/linuxfr.org $ bundle config set path 'vendor/bundle'
~/linuxfr.org $ bundle install
~/linuxfr.org $ bundle check
```

The `check` command above should say you there's no problem.

LinuxFr.org uses also some nodejs resources:

```
~/linuxfr.org $ npm install
```
{'fraction_non_alphanumeric': 0.09517144856543037, 'fraction_numerical': 0.006997900629811057, 'mean_word_length': 4.248470012239902, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '849942', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1290, 'n_words': 508}