Skip to content
This repository has been archived by the owner on Mar 25, 2019. It is now read-only.

Tools Installation and Setup

Enrico Spinielli edited this page Oct 17, 2018 · 37 revisions

WikiTools Installation and Setup

Prerequisites: IMPORTANT

On you Windows PC, set you proxy environment variables, http_proxy and https_proxy, up once and for all (well, until you will have to change your PC password):

  1. find the panel where to edit the environment variable

  2. if http_proxy or https_proxy does not yet exist, create it, i.e. press New button

  3. set each of the http_proxy and https_proxy variables value to (Note: http://)

      http://user:[email protected]:9512

    of course use as id you PC account id (without the Domain [i.e. SKY]), and as password you PC account password

Installation

You need the following tools (instructions in the sections below):

Git on Windows

  • Download the 64 bit portable version of Git for Windows.
  • Extract it in C:\opt\git

Test it!

  • Open the Git for Windows shell from your Start menu

  • Create a new folder for your repositories called C:\repos

  • Execute the following command on the shell:

    $ cd /c/repos/
    $ git clone https://github.com/euctrl-pru/website.git

    If all goes well you will now have a local copy of your website repository in the specified folder

Jekyll on Windows

The steps that follow are a subset of the instructions from Julian Thilo for installing Jekyll on Windows.

  1. Download RubyInstaller v2.2.x.

  2. Install it in C:\opt\Ruby22-x64).

  3. Update PATH and prepend it with C:\opt\Ruby22-x64\bin.

  4. download the Ruby DevKit for use with Ruby 2.0 and above (x64 - 64bits only)

  5. extract it in C:\opt\RubyDevKit\

  6. follow the instructions as from here in a MS Windows terminal:

    C:\Users\xyzzy> cd C:\opt\RubyDevKit\
    C:\opt\RubyDevKit> ruby dk.rb init

    Edit the generate config.yml file and put at the end:

    - C:/opt/Ruby22-x64
    

    Then run:

    C:\opt\RubyDevKit> ruby dk.rb install
  7. From a PowerShell or cmd terminal install jekyll and bundler:

    ~> gem install jekyll
    ~> gem install bundler
    ~> gem install wdm

Oracle SQLcl

  1. Download Command Line - SQLcl
  2. Unzip it under C:\opt\, it will create a folder like C:\opt\sqlcl-4.2.0.16.175.1027-no-jre
  3. Update PATH with C:\opt\sqlcl-4.2.0.16.175.1027-no-jre\sqlcl\bin (according to the version you installed)

Oracle SQL Developer (optional, i.e. if you do not have TOAD)

See this page

R and R Studio

Follow the instruction from Swirl or just do the following:

  • R

    • Download the R installer from here (MS Windows) (it will work even without admin rights.)
    • Install it under c:\opt\R, something like like C:\opt\R\R-3.2.2
  • RStudio

    • Download the RStudio Preview zip file from here
    • Unzip it under c:\opt\R, so that it will end up to something like like C:\opt\R\RStudio-1.0.44
  • RTools (needed for installation of packages from source)

    • Download the RTools from here, take the latest frozen version compatible with the above version of R, i.e. RTools33.exe

    • Install it under C:\Rtools (select the option to update PATH, the one for the update of the registry will fail, please uncheck it or ignore the error at the end of the installation)

    • in your HOME folder create a file, .Renviron, with your HTTP(s) proxy settings

      HTTP_PROXY = "<usr>:<password>@pac.eurocontrol.int:9512"
      HTTPS_PROXY = "<usr>:<password>@pac.eurocontrol.int:9512"
  • Run RStudio and install the tidyverse package by typing the following in the console:

    > install.packages("tidyverse")
  • ROracle

    • Download Instant Client from Oracle here
      (you need an account and have to agree on terms)
      • Instant Client Package - Basic (12.1 x64 version)
      • Instant Client Package - SDK (12.1 x64 version)
    • Unzip under C:\opt\oracle so that it all will end up to sometheing like C:\opt\oracle\instantclient_12_1
    • Set the environment variable OCI_LIB64 to C:\opt\oracle\instantclient_12_1
    • Add C:\opt\oracle\instantclient_12_1 to PATH
    • edit C:/opt/R/R-3.3.2/etc/$Arch/Makeconf file appropriately to point to the corresponding compiler for your machine's architecture (check with wmic os get osarchitecture, it should say something like 64-bit then $Arch above is x64) - this is new with the new toolchain we use with R >= 3.3.0:
      > BINPREF ?= c:/Rtools/mingw_64/bin/
    • From within RStudio
      • Check whether you development environment is ok:

        > system('g++ -v')
        Using built-in specs.
        COLLECT_GCC=C:\opt\R\Rtools33\GCC-46~1.3\bin\G__~1.EXE
        COLLECT_LTO_WRAPPER=c:/opt/r/rtools33/gcc-46~1.3/bin/../libexec/gcc/i686-w64-mingw32/4.6.3/lto-wrapper.exe
        Target: i686-w64-mingw32
        Configured with: /data/gannet/ripley/Sources/mingw-test3/src/gcc/configure ....
        Thread model: win32
        gcc version 4.6.3 20111208 (prerelease) (GCC) 
        > system('where make')
        C:\opt\R\Rtools33\bin\make.exe
      • Install the devtools package:

        > install.packages("devtools")
        > library(devtools)
        > find_rtools()
        [1] TRUE
      • Install the ROracle package:

        > install.packages("ROracle")

        and test it:

        > library(ROracle)
        > drv <- dbDriver("Oracle")
        > con <- dbConnect(drv, "prutest", "youknowthepassword", dbname="porape5")
        > rs <- dbSendQuery(con, "select sysdate from dual")
        > fetch(rs)
                      SYSDATE
        1 2016-11-04 12:58:25

        and disconnect at the end:

        > dbDisconnect(con)
  • Tools for package creation:

    • Ghostscript, qpdf and relevant ENV vars R_GSCMD, R_QPDF. See this link

General Configs

  • git push will push commits and tags at the same time:

    $ git config --global push.followTags true

Test the Installation

  • See Workflow Initialization

  • in case you get the following error Liquid Exception: incompatible character encodings: UTF-8 and IBM437 execute the following:

    $ /c/Windows/System32/chcp.com 65001
  • install the required gems

    ~> cd website
    ~> bundler install
  • build and serve the site

    ~> bundle exec jekyll build
    ~> bundle exec jekyll serve
  • point your browser to http://localhost:4000

Development

We clone website and work there (see Contributor Workflow). When happy we save the result in euctrl-pru.github.io.

Optional tools

For working from the command line, see hub and relevant binaries