mocdaniel / dashing-icinga2

Dashing dashboard for Icinga 2 using the REST API
MIT License
205 stars 47 forks source link

Cannot install on CentOS 7 / RHEL 7 - /usr/bin/ruby too old #98

Closed mtdeguzis closed 4 years ago

mtdeguzis commented 4 years ago

Expected Behavior

There is no ruby version that satisfies the requirement

Current Behavior

$ # gem install bundler                                                                                                                               
Fetching: bundler-2.0.2.gem (100%)
ERROR:  Error installing bundler:
        bundler requires Ruby version >= 2.3.0.

$ ruby --version
ruby 2.0.0p648 (2015-12-16) [x86_64-linux]

EPEL has no higher version of Ruby.

IRC:

[09:35] Anyone trying to use Dashing on CentOS 7, I can't due to ruby being too old: bundler requires Ruby version >= 2.3.0. [09:36] use rbenv for a newer ruby [09:40] Thanks @formorer, I'll look into that. Double checking Satellite / EPEL first again. [09:42] ProfessorKaos64: https://www.softwarecollections.org/en/scls/rhscl/rh-ruby25/ [09:42] software collections are the alternative

solution

Use RHSCL and document how, or use rbenv.

Your Environment

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7" REDHAT_BUGZILLA_PRODUCT_VERSION=7.4 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="7.4"

mocdaniel commented 4 years ago

Why not just go and use the newly added docker image or take the Dockerfile and adjust it to your needs?

mtdeguzis commented 4 years ago

@mocdaniel , suppose I could. The main reason for this issue is to at least adjust the readme expectations for CentOS 7 users / upgrade that expectation to CentOS 8 / remove it.

dnsmichi commented 4 years ago

Hm, I don't quite understand why you would need SCL. Inside the Icinga Vagrant boxes, Dashing is fully integrated with the default Ruby versions.

https://github.com/Icinga/icinga-vagrant/blob/master/.puppet/modules/profiles/manifests/dashing/icinga2.pp

dnsmichi commented 4 years ago

On another note, SCL probably makes sense. I just don't have the time right now to look into this.

thozook commented 4 years ago

I'm getting a similar error when attempting to issue the following command on CentOS 7:

gem install bundler

However, this step appears that it may be able to be skipped as it seems that the rubygem-bundler package installs a compatible version of bundler already, so the above command just works to attempt to update bundler to the latest version, which requires the updated Ruby version.

The modified steps I had to go through to use SCL(and Ruby 2.6) would be as follows:

  1. Install EPEL and SCL Repositories for CentOS 7 and then the packages

    yum makecache
    yum -y install epel-release centos-release-scl-rh
    yum -y install rh-ruby26-rubygems rh-ruby26-rubygem-bundler rh-ruby26-ruby-devel openssl gcc-c++ make nodejs
  2. Switch your current session to use the SCL Ruby version scl enable rh-ruby26 bash

  3. Update Bundler gem install bundler

  4. Install the dependencies using Bundler

    cd /usr/share/dashing-icinga2
    bundle

Systemd Service Had to edit the Systemd file provided at tools/systemd/dashing-icinga2.service and change the ExecStart and ExecStop lines to the following:

ExecStart=/usr/bin/scl enable rh-ruby26 -- dashing start -d -p 8005 --pid /var/run/thin.pid
ExecStop=/usr/bin/scl enable rh-ruby26 -- dashing stop
mtdeguzis commented 4 years ago

@thozook the above SCL usage seems to work for me. Need to fix up the dashboard, but it seems to work.

mocdaniel commented 4 years ago

I went through several scenarios of installing dashing-icinga in Centos7 and it turned out that the proposed installation method works just fine as long as you omit gem install bundler.

As @thozook already mentioned, a working bundler version is getting installed when installing ruby, nodejs, make etc, it is the forced update which breaks the installation process. I will update the README accordingly.