I have created a custom RPM package that provides a specific version of Ruby with a custom set of rubygems pre-installed. The RPM package installs ruby in a custom location: /usr/local/ruby_alt/
. So the installed ruby would be at: /usr/local/ruby_alt/bin/ruby
.
Some of the gems in the package have scripts that have a she-bang line referencing the custom Ruby installation (e.g. #!/usr/local/ruby_alt/bin/ruby
).
The RPM package was created with AutoReqProv=yes
(meaning rpmbuild will scan the contents of the package automatically for dependencies). rpmbuild correctly identifies /usr/local/ruby_alt/bin/ruby
as a dependency.
This package successfully installs on a CentOS 6 environment using the rpm command (e.g. rpm -i ruby_alt_pvdgm...
) with no errors or warnings.
When this rpm is placed in a custom yum repository and an attempt is made to install it using yum, we get:
$ sudo yum install ruby_alt_pvdgm
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: repos.redrockhost.com
* epel: fedora-epel.mirror.lstn.net
* extras: centos-distro.cavecreek.net
* updates: mirrors.loosefoot.com
Resolving Dependencies
--> Running transaction check
---> Package ruby_alt_pvdgm.x86_64 0:2.2.1-2.el6 will be installed
--> Processing Dependency: /usr/local/ruby_alt/bin/ruby for package: ruby_alt_pvdgm-2.2.1-2.el6.x86_64
--> Processing Dependency: /usr/local/ruby_alt/bin/ruby for package: ruby_alt_pvdgm-2.2.1-2.el6.x86_64
Packages skipped because of dependency problems:
ruby_alt_pvdgm-2.2.1-2.el6.x86_64 from fury
I understand that /usr/local/ruby_alt/bin/ruby
does not exist at the time of installation, but the package itself satisfies the dependency, so there should be no difficulty. Indeed, the rpm command - as mentioned earlier - installs the package with no problems.
Why would yum refuse to install this RPM package when the rpm command has no complaint?
EDIT: I have verified that both rpm and yum show /usr/local/ruby_alt/bin/ruby
as a dependency, so this is not a case of yum having more extensive dependency checking than the rpm command. Has no one else encountered a case where yum would refuse to install a package that satisfied it's own dependencies? As you recall from the discussion above, the package in question satisfies this dependency, which the rpm command seems to understand.