1

While installing puppet on RHEL6 I'm getting the following errors. Though I have installed ruby gems, I'm getting problems with ruby gems dependencies. How do I solve this problem?

[root@INFINI-ONE ~]# yum install puppet
Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
core-0                                                   | 1.8 kB     00:00     
core-1                                                   | 1.8 kB     00:00     
core-2                                                   | 1.8 kB     00:00     
core-3                                                   | 1.8 kB     00:00     
core-4                                                   | 1.8 kB     00:00     
core-5                                                   | 1.8 kB     00:00     
puppetlabs-deps                                          | 1.9 kB     00:00     
puppetlabs-products                                      | 1.9 kB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package puppet.noarch 0:3.2.1-1.el6 will be installed

--> Processing Dependency: facter >= 1.6.11 for package: puppet-3.2.1-1.el6.noarch

--> Processing Dependency: hiera >= 1.0.0 for package: puppet-3.2.1-1.el6.noarch

--> Processing Dependency: ruby(selinux) for package: puppet-3.2.1-1.el6.noarch

--> Processing Dependency: ruby-augeas for package: puppet-3.2.1-1.el6.noarch

--> Processing Dependency: ruby-rgen for package: puppet-3.2.1-1.el6.noarch

--> Processing Dependency: ruby-shadow for package: puppet-3.2.1-1.el6.noarch

--> Running transaction check

---> Package facter.x86_64 1:1.7.1-1.el6 will be installed

---> Package hiera.noarch 0:1.2.1-1.el6 will be installed

--> Processing Dependency: rubygem-json for package: hiera-1.2.1-1.el6.noarch

---> Package puppet.noarch 0:3.2.1-1.el6 will be installed

--> Processing Dependency: ruby(selinux) for package: puppet-3.2.1-1.el6.noarch

---> Package ruby-augeas.x86_64 0:0.4.1-1.el6 will be installed

---> Package ruby-rgen.noarch 0:0.6.2-1.el6 will be installed

---> Package ruby-shadow.x86_64 0:1.4.1-13.el6 will be installed

--> Running transaction check

---> Package puppet.noarch 0:3.2.1-1.el6 will be installed

--> Processing Dependency: ruby(selinux) for package: puppet-3.2.1-1.el6.noarch

---> Package rubygem-json.x86_64 0:1.5.5-1.el6 will be installed

--> Processing Dependency: rubygems for package: rubygem-json-1.5.5-1.el6.x86_64

--> Finished Dependency Resolution

Error: Package: rubygem-json-1.5.5-1.el6.x86_64 (puppetlabs-deps)
           Requires: rubygems

Error: Package: puppet-3.2.1-1.el6.noarch (puppetlabs-products)
           Requires: ruby(selinux)

 You could try using --skip-broken to work around the problem

 You could try running: rpm -Va --nofiles --nodigest

[root@INFINI-ONE ~]# gem -v

2.0.3
jagdish
  • 39

1 Answers1

2

Are the ruby gems you mention installed using the gem package manager or are they the actual RPMs for those gems?

I'm guessing they're gem installed. If so RPM knows nothing about them so will present this type of an error given it doesn't have any RPM record of these packages being installed.

You can list what gems are installed like this:

$ gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.10, 3.0.5)
actionpack (3.0.10, 3.0.5)
activemodel (3.0.10, 3.0.5)
activerecord (3.0.10, 3.0.5)
...

Potential resolution

I found this thread titled: puppet 3.x, rubygem pkg can't be found on a RHEL 6.4 that discusses this same issue. To resolve the issue it looks like you need to add an addition repository to your yum setup. You can do so with this command:

yum-config-manager --enable rhel-6-server-optional-rpms

Private ruby installs using rvm

If you find that you're having to deal with a lot of packages missing or having to roll your own for various gems you might want to forgo using RPMs and just build your own instance of Ruby + Gems using rvm. I discuss in this other U&L Q&A.

I've also blogged about setting up and using rvm here: How to use rvm installs of Ruby in shell & CGI scripts.

slm
  • 369,824
  • 1
    Just adding to say that you should avoid some ruby gems via 'gem' and some via yum -- just pick one and stick with it. Since you're using the puppet yum repos, stick to installing via yum, otherwise you'll end up in a mess of dependencies. I'd always suggest using yum, and if you find yourself needing a gem that's not packaged, build a package yourself, since you're using Puppet, it'll be easier to manage. – jsbillings Jun 04 '13 at 01:13
  • Agreed. This is terrific advice. If you don't want to have to install/build a bunch of RPMs for various gems I'd recommend making use of rvm and building a standalone instance of ruby + gems for your applications. – slm Jun 04 '13 at 01:26