Sorry, I'm reopening, but the issue is still present.
When you install Ruby, it carries initial version of /usr/bin/rdoc [1] (I picked up the RDoc as an example, but it is valid also for Rake, etc). Now let's assume that you will install updated RDoc, which replaces the file with the typical RubyGems stub, something like:
$ cat /usr/bin/rdoc
#!/usr/bin/ruby
#
# This file was generated by RubyGems.
#
# The application 'rdoc' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0"
if ARGV.first
str = ARGV.first
str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
if str =~ /\A_(.*)_\z/
version = $1
ARGV.shift
end
end
gem 'rdoc', version
load Gem.bin_path('rdoc', 'rdoc', version)
Now, this is problem for packaging systems, namely RPM (but I would be surprised if that is not issue for DEB as well). If you will do monolithic Ruby package, which provides /usr/bin/rdoc and later you want to package independent updated version of RDoc gem, which provides /usr/bin/rdoc as well, you are in conflict, since the files are different. If they would be the same (and there is no reason to be different IMO), there would be no conflict. The file would be own by two packages in parallel, which is supported scenario.
So what I'd like to see is the RubyGems stub in /usr/bin, especially after you committed r32608.
Actually, I'm trying to put together some proposal to solve #5481 and #6124, which might fix also this issue.
Thank you.
[1] https://github.com/ruby/ruby/blob/trunk/bin/rdoc