projectatomic / vagrant-service-manager

To provide the user a CLI to configure the ADB/CDK for different use cases and to provide glue between ADB/CDK and the user's developer environment.
GNU General Public License v2.0
18 stars 16 forks source link

Installation fails on RHEL 7 #442

Closed agajdosi closed 7 years ago

agajdosi commented 8 years ago

OS details: RHEL 7.3 workstation

Provider: Libvirt

Output of vagrant -v:

Vagrant 1.8.1

Output of vagrant plugin list:

vagrant-libvirt (0.0.32, system)

Output of vagrant service-manager box version:

xxx

Steps to reproduce the issue:

  1. vagrant plugin install vagrant-service-manager
  2. get error

Describe the results you received:

Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

An error occurred while installing ffi (1.9.14), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.14'` succeeds before bundling.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /opt/rh/rh-ruby22/root/usr/bin/ruby -r ./siteconf20161125-4674-djag84.rb extconf.rb 
mkmf.rb can't find header files for ruby at /opt/rh/rh-ruby22/root/usr/share/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /home/agajdosi/.vagrant.d/gems/gems/ffi-1.9.14 for inspection.
Results logged to /home/agajdosi/.vagrant.d/gems/extensions/x86_64-linux/ffi-1.9.14/gem_make.out

Gem install ffi without sudo gives:

[agajdosi@localhost cdk]$ gem install ffi -v '1.9.14'
Building native extensions.  This could take a while...
ERROR:  Error installing ffi:
    ERROR: Failed to build gem native extension.

    /opt/rh/rh-ruby22/root/usr/bin/ruby -r ./siteconf20161125-5023-wu4gae.rb extconf.rb
mkmf.rb can't find header files for ruby at /opt/rh/rh-ruby22/root/usr/share/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /home/agajdosi/.gem/ruby/gems/ffi-1.9.14 for inspection.
Results logged to /home/agajdosi/.gem/ruby/extensions/x86_64-linux/ffi-1.9.14/gem_make.out

With sudo it runs fine:

[agajdosi@localhost cdk]$ sudo gem install ffi -v '1.9.14'
[sudo] password for agajdosi: 
Building native extensions.  This could take a while...
Successfully installed ffi-1.9.14
Parsing documentation for ffi-1.9.14
1 gem installed

Installed packages are: libffi-devel, ruby-devel, rubygem-gssapi, rubygem-openscap, rubygem-ffi, libffi, gcc, @"Development Tools" Ruby version: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]

Describe the results you expected: Plugin installed.

LalatenduMohanty commented 7 years ago

@agajdosi Can you install from a local vagrant-service-manager gem?

agajdosi commented 7 years ago

@LalatenduMohanty Yes, local installation is fine.

coolbrg commented 7 years ago

This is what I got after debugging it

I was unable to install "vagrant-service-manager" plugin initially.

In my case, I found that package rh-ruby22-ruby-devel was missing. After installing it, plugin installation was working fine. However, there are other packages are also needed to make it work.

Following is the series of operations I performed to get my plugin installation worked.
{code}
[agajdosi@dhcp-24-185 ~]$ which vagrant
/usr/bin/which: no vagrant in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/agajdosi/.local/bin:/home/agajdosi/bin)

[agajdosi@dhcp-24-185 ~]$ vagrant -v
bash: vagrant: command not found...

# Need to enable vagrant somehow as
[agajdosi@dhcp-24-185 ~]$ sudo scl enable sclo-vagrant1 bash
[sudo] password for agajdosi: 

[root@dhcp-24-185 agajdosi]# vagrant -v
Vagrant 1.8.1

[root@dhcp-24-185 agajdosi]# which vagrant
/opt/rh/sclo-vagrant1/root/usr/bin/vagrant

[root@dhcp-24-185 agajdosi]# ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]

[root@dhcp-24-185 agajdosi]# vagrant plugin list
vagrant-libvirt (0.0.32, system)

[root@dhcp-24-185 agajdosi]# vagrant plugin install vagrant-service-manager
Installing the 'vagrant-service-manager' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

An error occurred while installing ffi (1.9.14), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.14'` succeeds before bundling.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /opt/rh/rh-ruby22/root/usr/bin/ruby -r ./siteconf20161128-17058-tc23l8.rb extconf.rb 
mkmf.rb can't find header files for ruby at /opt/rh/rh-ruby22/root/usr/share/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /root/.vagrant.d/gems/gems/ffi-1.9.14 for inspection.
Results logged to /root/.vagrant.d/gems/extensions/x86_64-linux/ffi-1.9.14/gem_make.out

[root@dhcp-24-185 agajdosi]# sudo yum  install libvirt-devel
.........
Installed:
  libvirt-devel.x86_64 0:2.0.0-10.el7                                                                                                                        
Complete!

[root@dhcp-24-185 agajdosi]# sudo yum install @'Development Tools'
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Nothing to do

[root@dhcp-24-185 agajdosi]# sudo yum install rpm-build zlib-devel ruby-devel gcc-c++
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Package rpm-build-4.11.3-21.el7.x86_64 already installed and latest version
Package zlib-devel-1.2.7-17.el7.x86_64 already installed and latest version
Package ruby-devel-2.0.0.648-29.el7.x86_64 already installed and latest version
Package gcc-c++-4.8.5-11.el7.x86_64 already installed and latest version
Nothing to do

[root@dhcp-24-185 agajdosi]# sudo yum -y install rh-ruby22-ruby-devel
..............
Installed:
  rh-ruby22-ruby-devel.x86_64 0:2.2.2-16.el7                                                                                                                  
Complete!

[root@dhcp-24-185 agajdosi]# vagrant plugin install vagrant-service-manager
Installing the 'vagrant-service-manager' plugin. This can take a few minutes...
Installed the plugin 'vagrant-service-manager (1.4.1)'!

[root@dhcp-24-185 agajdosi]# vagrant plugin install vagrant-registration vagrant-sshfs
Installing the 'vagrant-registration' plugin. This can take a few minutes...
Installed the plugin 'vagrant-registration (1.3.1)'!
Installing the 'vagrant-sshfs' plugin. This can take a few minutes...
Installed the plugin 'vagrant-sshfs (1.3.0)'!

[root@dhcp-24-185 agajdosi]# vagrant plugin list
vagrant-libvirt (0.0.36, system)
vagrant-registration (1.3.1)
vagrant-service-manager (1.4.1)
vagrant-sshfs (1.3.0)
{code}
coolbrg commented 7 years ago

@Preeticp Please update it as one of dependency for RHEL in doc here https://github.com/projectatomic/adb-atomic-developer-bundle/blob/master/docs/installing.adoc#install-dependencies

coolbrg commented 7 years ago

Closing it now since the command is added in above docs.