It seems that rdoc of lang/ruby26 is broken. Any idea? % rdoc docs/bdb.rb Traceback (most recent call last): 2: from /usr/local/bin/rdoc:23:in `<main>' 1: from /usr/local/lib/ruby/site_ruby/2.6/rubygems.rb:302:in `activate_bin_path' /usr/local/lib/ruby/site_ruby/2.6/rubygems.rb:283:in `find_spec_for_exe': can't find gem rdoc (>= 0.a) with executable rdoc (Gem::GemNotFoundException) % rdoc26 docs/bdb.rb Traceback (most recent call last): 2: from /usr/local/bin/rdoc26:23:in `<main>' 1: from /usr/local/lib/ruby/site_ruby/2.6/rubygems.rb:302:in `activate_bin_path' /usr/local/lib/ruby/site_ruby/2.6/rubygems.rb:283:in `find_spec_for_exe': can't find gem rdoc (>= 0.a) with executable rdoc (Gem::GemNotFoundException) % ruby -v ruby 2.6.3p62 (2019-04-16 revision 67580) [amd64-freebsd11]
ri and irb doesn't work, too. % ri26 Traceback (most recent call last): 2: from /usr/local/bin/ri26:23:in `<main>' 1: from /usr/local/lib/ruby/2.6/rubygems.rb:302:in `activate_bin_path' /usr/local/lib/ruby/2.6/rubygems.rb:283:in `find_spec_for_exe': can't find gem rdoc (>= 0.a) with executable ri (Gem::GemNotFoundException) % irb26 Traceback (most recent call last): 2: from /usr/local/bin/irb26:23:in `<main>' 1: from /usr/local/lib/ruby/2.6/rubygems.rb:302:in `activate_bin_path' /usr/local/lib/ruby/2.6/rubygems.rb:283:in `find_spec_for_exe': can't find gem irb (>= 0.a) with executable irb (Gem::GemNotFoundException)
Have you installed it rubygem-rdoc for Ruby 2.6? See how /usr/local/bin/rdoc be. It is just a wrapper script since Ruby 2.6. Not an rdoc itself. rubygem-rdoc port needs to be installed. Same with irb. Ruby < 2.6, /usr/local/bin/irb is a irb itself. However Ruby >= 2.6 , it is no longer irb itself. It is a wrapper script to call irb gem. irb gem port doesn't exist right now. It should be created.
I've created bug 237830 for irb.
(In reply to Koichiro Iwao from comment #2) Yes, I confirmed that installing rubygem-rdoc makes rdoc work. However, I cannot think that it is intentional to installbroken rdoc without rubygem-rdoc installed.
(In reply to Hajimu UMEMOTO from comment #4) It is not intentional. What about adding these gems runtime dependency of lang/ruby26?
Created attachment 204366 [details] patch
(In reply to Koichiro Iwao from comment #5) Adding run_depend to gems is still workaround. Installing broken rdoc by lang/ruby26 seems bad idea.
(In reply to Hajimu UMEMOTO from comment #7) However, it is a gem. What is your plan?
(In reply to Koichiro Iwao from comment #8) I'm not sure how the default gem should be handled, but, the default gem seems different from the regular gem. Perhaps, it should be: 1. Stop installing the broken bin scripts and useless related libs if any, by lang/ruby26. 2. Providing the separated default gem port like ruby26-rdoc which built and installed from the Ruby 2.6.X source. 3. The separated default gem port installs the bin script as well. 4. Optionally, the separate ports are RUN_DEPENDS from lang/ruby26. 5. The rubygem-rdoc can be installed to use latest version of the rdoc.
I will learn about default gem and consider what should be done.
As I already mentioned, irb, rdoc, ri and perhaps other components are installed as default gems since Ruby 2.6. However, files/patch-tool_rbinstall.rb prevents installing default gems. This is the cause why rdoc etc is not installed. https://svnweb.freebsd.org/ports/head/lang/ruby26/files/patch-tool_rbinstall.rb?revision=501068&view=markup#l27 There should be a certain reason why this patch is added. Just removing the patch might break something so the patch needs to be removed carefully.
Ruby 2.6 is now default r511605. Let's make irb, rdoc, ri as part of lang/ruby26.
After upgrading to Ruby 2.6 I can no longer start irb: $ irb Traceback (most recent call last): 2: from /usr/local/bin/irb:23:in `<main>' 1: from /usr/local/lib/ruby/site_ruby/2.6/rubygems.rb:303:in `activate_bin_path' /usr/local/lib/ruby/site_ruby/2.6/rubygems.rb:284:in `find_spec_for_exe': can't find gem irb (>= 0.a) with executable irb (Gem::GemNotFoundException) This is with ruby-2.6.4,1 compiled with Poudriere using default make options on FreeBSD 12.0-REL amd64. Thanks.
(In reply to mail from comment #13) Have you tried to install what the error message tells you? pkg install rubygem-irb
(In reply to Matthias Fechner from comment #14) OK, irb works after installing devel/rubygem-irb. I'm not a Ruby user so that step was non-obvious, nor was it automatic after upgrading from Ruby 2.5. Obviously rubygem-irb should be required as a dependency for a functioning Ruby installation.
Kimura-san, what do you think if I just remove files/patch-tool_rbinstall.rb and include irb, rdoc, ri default gems as part of lang/ruby26?
(In reply to Koichiro Iwao from comment #16) I think the patch makes things difficult. It exists since Ruby 1.9.3 as far as I follow svn log. Now it is time to refine the patch. Ruby has been changed, but the patch hasn't been changed.
(In reply to Koichiro Iwao from comment #16) Iwao-san, Sorry for late response. I tried removing this patch and saw what happened. The result was that following gems were installed under /usr/local/lib/ruby/2.6 (directory where rubygem ports install their files). * bundler 1.17.2 * did_you_mean 1.3.0 * irb 1.0.0 * minitest 5.11.3 * net-telnet 0.2.0 * power_assert 1.1.3 * rake 12.3.2 * rdoc 6.1.2 * test-unit 3.2.9 * xmlrpc 0.3.0 I found some of them exists as rubygem port in ports tree. And some of such ports has same version as above. That is, removing this patch results in installed file conflict with some rubygem ports. So this patch shouldn't be removed. I also found there isn't port of did_you_mean gem in ports tree. So it may be we should create it. From this result I think we need to review other patches and understand what they do and/or why they are necessary. Furthermore, it may be we need to ask ourselves following fundamental question. "What should (or shouldn't) be install by this port?" To be honest, I think I should have made consensus about answer to this question with others before I start creating lang/ruby26 port.
A commit references this bug: Author: meta Date: Wed Jan 29 02:25:24 UTC 2020 New revision: 524527 URL: https://svnweb.freebsd.org/changeset/ports/524527 Log: lang/ruby27: throw out racc from lang/ruby27 because racc is provied as "default gem" since Ruby 2.7 [1]. We provide default gems as gem ports rather than a part of lang/ruby* port. files/patch-tool_rbinstall.rb does that. bin/*racc* are leftover wrapper script that the patch didn't remove default gem racc completely. racc is provided by devel/rubygem-racc. To avoid conflict racc gem port vs ruby port, throw it out completely from ruby port. [1] https://ruby-trunk-changes.hatenablog.com/entry/ruby_trunk_changes_20190620 PR: 242359 237833 Submitted by: Yasuhiro KIMURA <yasu@utahime.org> (based on) Changes: head/Mk/bsd.ruby.mk head/lang/ruby27/Makefile head/lang/ruby27/pkg-plist
(In reply to Koichiro Iwao from comment #17) What is the current state of this? The "default install" of ruby26 is still corrupt and that is the default version. This is really ugly and really should be taken care off. Thanks for taking a look at this!