Bug 237833 - lang/ruby26: irb, rdoc, ri is broken
Summary: lang/ruby26: irb, rdoc, ri is broken
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Koichiro Iwao
URL: https://lists.freebsd.org/pipermail/f...
Keywords:
Depends on: 237870
Blocks:
  Show dependency treegraph
 
Reported: 2019-05-11 05:09 UTC by Hajimu UMEMOTO
Modified: 2019-09-13 12:05 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (ruby)


Attachments
patch (564 bytes, patch)
2019-05-14 00:34 UTC, Koichiro Iwao
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hajimu UMEMOTO freebsd_committer 2019-05-11 05:09:13 UTC
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]
Comment 1 Koichiro Iwao freebsd_committer 2019-05-13 04:46:44 UTC
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)
Comment 2 Koichiro Iwao freebsd_committer 2019-05-13 05:43:08 UTC
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.
Comment 3 Koichiro Iwao freebsd_committer 2019-05-13 08:50:43 UTC
I've created bug 237830 for irb.
Comment 4 Hajimu UMEMOTO freebsd_committer 2019-05-13 12:31:22 UTC
(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.
Comment 5 Koichiro Iwao freebsd_committer 2019-05-14 00:06:38 UTC
(In reply to Hajimu UMEMOTO from comment #4)
It is not intentional. What about adding these gems runtime dependency of lang/ruby26?
Comment 6 Koichiro Iwao freebsd_committer 2019-05-14 00:34:48 UTC
Created attachment 204366 [details]
patch
Comment 7 Hajimu UMEMOTO freebsd_committer 2019-05-14 12:27:24 UTC
(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.
Comment 8 Koichiro Iwao freebsd_committer 2019-05-14 12:54:47 UTC
(In reply to Hajimu UMEMOTO from comment #7)
However, it is a gem. What is your plan?
Comment 9 Hajimu UMEMOTO freebsd_committer 2019-05-14 17:19:36 UTC
(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.
Comment 10 Koichiro Iwao freebsd_committer 2019-05-17 05:34:45 UTC
I will learn about default gem and consider what should be done.
Comment 11 Koichiro Iwao freebsd_committer 2019-05-28 02:20:43 UTC
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.
Comment 12 Koichiro Iwao freebsd_committer 2019-09-09 09:23:29 UTC
Ruby 2.6 is now default r511605. Let's make irb, rdoc, ri as part of lang/ruby26.
Comment 13 mail 2019-09-12 03:48:51 UTC
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.
Comment 14 Matthias Fechner freebsd_committer 2019-09-12 21:23:28 UTC
(In reply to mail from comment #13)
Have you tried to install what the error message tells you?
pkg install rubygem-irb
Comment 15 mail 2019-09-13 01:39:10 UTC
(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.