Installation (UNIX or OS X)

On Mac OS X and UNIX-like operating systems, such as Linux, you have a choice of using an automatic installer script (if you’re not using JRuby for anything else), or manual installation.

Automatic installation

Check Java is installed

To check Java is installed, in a Terminal window, type java -version

You must use Java 8, build 212 or later. The version number will be shown as ‘1.8’. (Later versions of Java will be supported when the JRuby runtime is compatible.)

If you get an error, or need to update to a recent version of Java 8, download Java and install it in the default folder. You can get a free Java JVM from Adoptium. Repeat the java -version command to check it installed correctly.

If you are using a Linux system, your package manager should be able to install Java 8 for you.

Run the automatic installation script

Open a new Terminal window and download the haplo_plugin_install.sh installation script:

    curl -O https://raw.githubusercontent.com/haplo-org/haplo-plugin-tool/master/install/haplo_plugin_install.sh

Before executing the script, review the contents in your text editor of choice. The script downloads the binary release of JRuby into ~/haplo-dev-support/haplo-plugin , installs the haplo ruby gem, and appends the new jruby/bin directory to your PATH by adding a line to the ~/.profile of your current user.

To install, run the script with:

    sh haplo_plugin_install.sh

After installation, open a new Terminal window or run source ~/.profile and type:

    haplo-plugin --help

to ensure installation was successful.

If you receive a command not found error check the output of echo $PATH . It should contain the jruby/bin directory from the haplo-dev-support/haplo-plugin directory. If it does not, you may need to move the installer added line from ~/.profile to ~/.bash_profile or ~/.bash_login

 

 

Manual installation

Check Java is installed

In the Terminal window, type java -version

You must have Java 8 or later. The version number shown will be prefixed with ‘1.’, so Java 8’s version will be shown as ‘1.8’.

If you get an error, or need to update to Java 8, download Java and install it in the default folder. Repeat the java -version command to check it installed correctly.

If you are using a Linux system, your package manager should be able to install Java 8 for you.

Download JRuby

Download the current release of JRuby, which must be version 9.2.17.0 or later. Choose the “binary .tar.gz” version.

Decompress the downloaded file, then rename the extracted folder to jruby (without the version number):

    tar zxf ruby-bin-9.2.17.0.tar.gz
    mv jruby-9.2.17.0 jruby

Install the Plugin Tool

The Plugin Tool is distributed as a Ruby Gem.

Return to the Terminal window you opened. Type

    export PATH=`pwd`/jruby/bin:$PATH
    jgem install haplo

(This assumes you’re running these commands with the current working directory set to the directory containing jruby.)

Create a project folder

Create a folder inside your working folder, for example, /Users/developer/haplo-development/example-project, and cd to it. In the cmd window, type

    mkdir example-project
    cd example-project

Check the installation works

Type haplo-plugin --help to check the plugin tool is installed correctly.

Persist PATH across sessions

If you installed JRuby manually, then you will either need to set your PATH every time you open a new Terminal window or alternatively configure your system to automatically append the jruby/bin directory to the PATH.

To do so, add:

    export PATH=/Users/developer/haplo-development/jruby/bin:$PATH

to your shell configuration file.