Issue #15407 has been updated by naruse (Yui NARUSE).

Status changed from Assigned to Closed

It's fixed by r66384

----------------------------------------
Bug #15407: bundle, bundler, irb, rdoc, ri commands broken if --program-suffix configure option is used
https://bugs.ruby-lang.org/issues/15407#change-75695

* Author: jeremyevans0 (Jeremy Evans)
* Status: Closed
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Target version: 2.6
* ruby -v: ruby 2.6.0rc1 (2018-12-06 trunk 66253) [x86_64-openbsd]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
With recent changes to tool/rbinstall.rb, if you use --program-suffix (or a similar option),
it will result in bundle, bundler, irb, rdoc, ri not working, because they try to load a
file from the gem directory which has been modified with the same suffix.  

~~~
$ irb26
Traceback (most recent call last):
        1: from /usr/local/bin/irb26:23:in `<main>'
/usr/local/bin/irb26:23:in `load': cannot load such file -- /usr/local/lib/ruby/gems/2.6/gems/irb-0.9.6/exe/irb (LoadError)
$ rdoc26
Traceback (most recent call last):
        1: from /usr/local/bin/rdoc26:23:in `<main>'
/usr/local/bin/rdoc26:23:in `load': cannot load such file -- /usr/local/lib/ruby/gems/2.6/gems/rdoc-6.1.0.beta2/exe/rdoc (LoadError)
$ ri26
Traceback (most recent call last):
        1: from /usr/local/bin/ri26:23:in `<main>'
/usr/local/bin/ri26:23:in `load': cannot load such file -- /usr/local/lib/ruby/gems/2.6/gems/rdoc-6.1.0.beta2/exe/ri (LoadError)
$ bundler26
Traceback (most recent call last):
        1: from /usr/local/bin/bundler26:23:in `<main>'
/usr/local/bin/bundler26:23:in `load': cannot load such file -- /usr/local/lib/ruby/gems/2.6/gems/bundler-2.0.0/exe/bundler (LoadError)
$ bundle26
Traceback (most recent call last):
        1: from /usr/local/bin/bundle26:23:in `<main>'
/usr/local/bin/bundle26:23:in `load': cannot load such file -- /usr/local/lib/ruby/gems/2.6/gems/bundler-2.0.0/exe/bundle (LoadError)
~~~

These LoadErrors happen because ruby when configured with the --program-suffix option
installs the irb gem exe file as `/usr/local/lib/ruby/gems/2.6/gems/irb-0.9.6/exe/irb26`
(with similar issues for other default gems with executables).

Attached is a patch that modifies tool/rbinstall.rb so that the files in the gem directory
are not renamed on install.  I'm not sure whether this patch causes other issues, but I can
confirm it does fix the problem described if --program-suffix is used.

---Files--------------------------------
rbinstall.diff (739 Bytes)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>