Bug #5060

Executables in bin folder conflict with their gem versions.

Added by Vit Ondruch over 4 years ago. Updated over 2 years ago.

ruby -v:


It would be nice if the executables for rdoc, rake, ri, etc. locate in bin folder, would be standard RubyGems stubs. Otherwise, once there is installed version of such library as a gem, the original file is rewritten and the functionality of bundled library is lost.

But my main concern is the conflict between ruby and gem executables, since it makes packaging for Linux distributions hard (for Fedora and RHEL in my case).

Related issues

Related to Ruby trunk - Bug #4485: Gem.bin_path('rake') does not return the path of the system-installed rake Closed 03/09/2011


#1 [ruby-core:38485] Updated by Yui NARUSE over 4 years ago

  • Status changed from Open to Assigned
  • Assignee set to Eric Hodel
  • Target version set to 2.0.0

#2 [ruby-core:38506] Updated by Eric Hodel over 4 years ago

  • Status changed from Assigned to Closed

Since I committed r32608 and r32611 I think this issue is now invalid.

If a different version of rake or rdoc are installed they will behave the same as the bundled library. rake will load the built-in version of rake, for example. If a newer version of RDoc were installed rdoc and ri would behave the same.

I'm closing this ticket unless differing behavior can be reproduced.

#3 [ruby-core:45745] Updated by Vit Ondruch over 3 years ago

  • Status changed from Closed to Assigned

Sorry, I'm reopening, but the issue is still present.

When you install Ruby, it carries initial version of /usr/bin/rdoc 1. 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

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

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.


#4 [ruby-core:52363] Updated by Eric Hodel almost 3 years ago

  • Target version changed from 2.0.0 to next minor

This is too risky to fix for 2.0.0, sorry I did not have time.

#5 [ruby-core:57850] Updated by Salimane Adjao Moustapha over 2 years ago

drbrain (Eric Hodel) wrote:

This is too risky to fix for 2.0.0, sorry I did not have time.
I would like to know when this issue can be solved and pushed into trunk at least :)

Also available in: Atom PDF