7

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.

1
  • 7
    Try gem install rdoc Commented Feb 7, 2022 at 17:44

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.