在 RHEL6 上安装 puppet 时,出现以下错误。虽然我已经安装了 ruby gems,但我遇到了 ruby gems 依赖项的问题。我该如何解决这个问题?
[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
答案1
您提到的 ruby gem 是使用 gem 包管理器安装的还是这些 gem 的实际 RPM?
我猜他们已经安装了 gem。如果是这样,RPM 对它们一无所知,因此会出现此类错误,因为它没有安装这些软件包的任何 RPM 记录。
您可以像这样列出安装了哪些 gem:
$ 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)
...
潜在解决方案
我发现这个帖子的标题是:在 RHEL 6.4 上找不到 puppet 3.x、rubygem pkg讨论同一问题。要解决此问题,您似乎需要在 yum 设置中添加一个附加存储库。您可以使用以下命令来执行此操作:
yum-config-manager --enable rhel-6-server-optional-rpms
使用rvm安装私有ruby
如果您发现必须处理大量丢失的软件包或必须为各种 gem 自行推出,您可能想放弃使用 RPM,而只需使用以下命令构建自己的 Ruby + Gems 实例右室。我在另一个讨论U&L问答。
我还在此处发布了有关设置和使用 rvm 的博客:如何在 shell 和 CGI 脚本中使用 Ruby 的 rvm 安装。