6

While trying to run the "irb", I ran into this error:

<internal:/usr/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- rdoc (LoadError)

from

from <internal:/usr/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /usr/lib/ruby/gems/3.0.0/gems/irb-1.4.1/lib/irb/input-method.rb:17:in `<top (required)>'
from /usr/lib/ruby/gems/3.0.0/gems/irb-1.4.1/lib/irb/context.rb:14:in `require_relative'
from /usr/lib/ruby/gems/3.0.0/gems/irb-1.4.1/lib/irb/context.rb:14:in `<top (required)>'
from /usr/lib/ruby/gems/3.0.0/gems/irb-1.4.1/lib/irb.rb:16:in `require_relative'
from /usr/lib/ruby/gems/3.0.0/gems/irb-1.4.1/lib/irb.rb:16:in `<top (required)>'
from <internal:/usr/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /usr/lib/ruby/gems/3.0.0/gems/irb-1.4.1/exe/irb:9:in `<top (required)>'
from /usr/bin/irb:25:in `load'
from /usr/bin/irb:25:in `<main>'

I tried downgrading the ruby version from 3.0.3 to 2.7, but didn't work; had the same error.

Gupta
  • 8,882
  • 4
  • 49
  • 59
jack-p
  • 63
  • 1
  • 4

2 Answers2

1

For me, running gem install rdoc did not work,so i added this to the Gemfile: gem "rdoc", require: false, then ran bundle install. That worked.

0

I was having the same issue on my Alpine system. Rather than using gem (which wouldn't play nice with apk), sudo apk add ruby-rdoc did the trick (note: ruby-rdoc, not ruby-doc).

ShadowRanger
  • 143,180
  • 12
  • 188
  • 271