# \[SOLVED\] Problem compiling OpenNebula 5.4.0 gems in Centos7

**URL:** <https://forum.opennebula.io/t/solved-problem-compiling-opennebula-5-4-0-gems-in-centos7/4800>\
**Category:** Product Support\
**Created:** [August 23, 2017, 8:02am UTC](https://forum.opennebula.io/t/solved-problem-compiling-opennebula-5-4-0-gems-in-centos7/4800 "2017-08-23T08:02:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alvaro\_simongarcia](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/alvaro_simongarcia/32/4178_2.png) [@alvaro\_simongarcia](https://forum.opennebula.io/u/alvaro_simongarcia)\
**Post date:** [August 23, 2017, 8:02am UTC](https://forum.opennebula.io/t/solved-problem-compiling-opennebula-5-4-0-gems-in-centos7/4800/1 "2017-08-23T08:02:32Z")

</div>

Hi all

I’m not sure if this is an known issue or not.  
I’m trying to generate the new gem rpm packages required by OpenNebula 5.4.0 version but I got this error:

```
...
Compiling required gems.. Please wait.
ERROR: Error installing nokogiri:
	nokogiri requires Ruby version >= 2.1.0.

```

It looks like `install_gems` tries to install the latest nokogiri version but at this moment it requires Ruby `2.1.0` unfortunately in Centos7:

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

```

I have generated the same package some months ago: `rubygem-nokogiri-1.6.6.2-1.x86_64` that seems to work with OpenNebula 5.4.0…

My question is if OpenNebula 5.4.0 requires the latest version or with nokogiri 1.6.6 also works (I did some tests and it seems to work but I’m not 100% sure).

If so, it would be possible to include a version lock for nokogiri in `install_gems` script?, for OpenNebula 5.4.0 it has these dependencies:

```
$ /usr/share/one/install_gems --showallgems
**nokogiri**
rack --version "< 2.0.0"
**sinatra**
thin
memcache-client
zendesk_api --version "< 1.14.0"
sqlite3
sequel
amazon-ec2
uuidtools
curb
net-ldap --version "< 0.13"
builder
trollop
treetop --version ">= 1.6.3"
parse-cron
aws-sdk --version "~> 2.5"
ox
mysql2
aws-sdk
configparser
**azure**

```

Thanks a lot in advance!

Cheers  
Álvaro

---

<div class="post-metadata">

**Author:** ![alvaro\_simongarcia](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/alvaro_simongarcia/32/4178_2.png) [@alvaro\_simongarcia](https://forum.opennebula.io/u/alvaro_simongarcia)\
**Post date:** [August 23, 2017, 8:13am UTC](https://forum.opennebula.io/t/solved-problem-compiling-opennebula-5-4-0-gems-in-centos7/4800/2 "2017-08-23T08:13:41Z")

</div>

btw I got a similar error for `sinatra` and `azure` gems , the versions are also not restricted

---

<div class="post-metadata">

**Author:** ![marcindulak](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@marcindulak](https://forum.opennebula.io/u/marcindulak)\
**Post date:** [August 23, 2017, 8:26am UTC](https://forum.opennebula.io/t/solved-problem-compiling-opennebula-5-4-0-gems-in-centos7/4800/3 "2017-08-23T08:26:26Z")

</div>

Maybe your OS is not clean, installing custom RPMS is normally not a good idea.  
Is there a specific reason to use a custom rubygem-nokogiri RPM?  
Here is what happens to me on a clean, up-to-date CentOS 7.3:

> [root@frontend ~]# cat /etc/redhat-release  
> CentOS Linux release 7.3.1611 (Core)

> [root@frontend ~]# ruby --version  
> ruby 2.0.0p648 (2015-12-16) [x86\_64-linux]

> [root@frontend ~]# rpm -q rubygem-nokogiri  
> rubygem-nokogiri-1.6.1-1.el7.1.x86\_64

> [root@frontend ~]# /usr/share/one/install\_gems --showallgems  
> nokogiri  
> rack --version “\< 2.0.0”  
> sinatra  
> thin  
> memcache-client  
> zendesk\_api --version “\< 1.14.0”  
> sqlite3  
> sequel  
> amazon-ec2  
> uuidtools  
> curb  
> net-ldap --version “\< 0.13”  
> builder  
> trollop  
> treetop --version “\>= 1.6.3”  
> parse-cron  
> aws-sdk --version “~\> 2.5”  
> ox  
> mysql2  
> aws-sdk  
> configparser  
> azure

> [root@frontend ~]# gem list
> 
> \*\*\* LOCAL GEMS \*\*\*
> 
> addressable (2.4.0)  
> amazon-ec2 (0.9.17)  
> aws-sdk (2.5.10)  
> aws-sdk-core (2.5.10)  
> aws-sdk-resources (2.5.10)  
> azure (0.7.6)  
> azure-core (0.1.4)  
> bigdecimal (1.2.0)  
> builder (3.2.2)  
> bundler (1.15.4)  
> configparser (0.1.4)  
> curb (0.9.3)  
> daemons (1.2.4)  
> eventmachine (1.2.0.1)  
> faraday (0.9.2)  
> faraday\_middleware (0.10.0)  
> hashie (3.4.4)  
> inflection (1.0.0)  
> io-console (0.4.2)  
> jmespath (1.3.1)  
> json (1.8.3, 1.7.7)  
> memcache-client (1.8.5)  
> mime-types (2.99.2)  
> multipart-post (2.0.0)  
> mysql2 (0.4.9)  
> net-ldap (0.12.1)  
> nokogiri (1.6.1)  
> ox (2.4.4)  
> parse-cron (0.1.4)  
> polyglot (0.3.5)  
> psych (2.0.0)  
> rack (1.6.4)  
> rack-protection (1.5.3)  
> rake (0.9.6)  
> rdoc (4.0.0)  
> scrub\_rb (1.0.1)  
> sequel (4.38.0)  
> sinatra (1.4.7)  
> sqlite3 (1.3.11)  
> systemu (2.6.5)  
> thin (1.7.0)  
> thor (0.19.1)  
> tilt (2.0.5)  
> treetop (1.6.8)  
> trollop (2.1.2)  
> uuidtools (2.1.5)  
> xml-simple (1.1.5)  
> zendesk\_api (1.13.4)

---

<div class="post-metadata">

**Author:** ![jfontan](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jfontan/32/18_2.png) [@jfontan](https://forum.opennebula.io/u/jfontan)\
**Post date:** [August 23, 2017, 8:35am UTC](https://forum.opennebula.io/t/solved-problem-compiling-opennebula-5-4-0-gems-in-centos7/4800/4 "2017-08-23T08:35:00Z")

</div>

`install_gems` now uses bundler by default and it needs the file `Gemfile.lock` in the same directory as `Gemfile` and `install_gems` to get the exact gem versions. There are specific versions per distribution, you can find the CentOS version here:

> <https://github.com/OpenNebula/one/blob/master/share/install_gems/CentOS7/Gemfile.lock>

When the packages are built these files are placed in the correct directory.

In case you want to download the gems you can use bundler, execute this in a directory with both `Gemfile` and `Gemfile.lock`:

```nohighlight
$ bundler install --path my_gems

```

The libraries will be downloaded to the directory `my_gems`.

---

<div class="post-metadata">

**Author:** ![alvaro\_simongarcia](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/alvaro_simongarcia/32/4178_2.png) [@alvaro\_simongarcia](https://forum.opennebula.io/u/alvaro_simongarcia)\
**Post date:** [August 23, 2017, 9:22am UTC](https://forum.opennebula.io/t/solved-problem-compiling-opennebula-5-4-0-gems-in-centos7/4800/5 "2017-08-23T09:22:58Z")

</div>

Hi

Ah… that means that we should update the [addon-installgems](https://github.com/OpenNebula/addon-installgems) to take into account these changes and use `bundler` if the `Gemfile.lock` is available.

Thanks a lot for the info! I will try to write a PR to take into account these changes as soon as possible, in fact this simplifies the dependencies problem a lot.

Cheers  
Álvaro
