undefined method `reset' for RDoc::TopLevel:Class when installing a new Ruby gem undefined method `reset' for RDoc::TopLevel:Class when installing a new Ruby gem ruby ruby

undefined method `reset' for RDoc::TopLevel:Class when installing a new Ruby gem


When installing rdoc it tries to generate its own documentation using rdoc. The binary is installed (probably in /usr/bin), but it will not be found at the moment of gem install - if this is the first time.gem install rdoc --no-document


I had a similar issue:

$ gem install rdocFetching: rdoc-6.0.4.gem (100%)WARNING:  You don't have /home/myusername/.gem/ruby/2.5.0/bin in your PATH,      gem executables will not run.Successfully installed rdoc-6.0.4ERROR:  While executing gem ... (NoMethodError)    undefined method `reset' for RDoc::TopLevel:Class

Same when installing compass. After adding /home/myusername/.gem/ruby/2.5.0/bin to $PATH, this worked for me:

$ gem install rdocSuccessfully installed rdoc-6.0.4Parsing documentation for rdoc-6.0.4Installing ri documentation for rdoc-6.0.4Done installing documentation for rdoc after 3 seconds1 gem installed