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

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


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



For example,


$ gem install netaddr
Fetching: netaddr-1.5.1.gem (100%)
Successfully installed netaddr-1.5.1
ERROR: While executing gem ... (NoMethodError)
undefined method `reset' for RDoc::TopLevel:Class



The NoMethodError exception keeps being raised when I install any new gem. I googled about it and searched issues in RDoc and RubyGems GitHub repositories, but had no luck.



My Ruby version is


$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]



The RubyGems version is


$ gem -v
2.5.1



The installed RDoc version is


$ gem search rdoc -l

*** LOCAL GEMS ***

rdoc (4.2.2, 4.2.1)



I installed Ruby with RVM on Mac OS X El Capitan.



Thanks!





I have exactly the same environment as you do, except for ruby version (mine is ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]), and had no problem installing the gem.
– dhrubo_moy
Aug 20 '16 at 4:20


ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]





I've got the same problem as OP with ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] & gem 2.7.7 and for me it happened while installing rdoc itself: rdoc-6.0.4
– konserw
Jun 2 at 12:39




ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]


gem 2.7.7


rdoc-6.0.4





Did anyone figure this out?
– Josh Edwards
Jul 13 at 11:38




1 Answer
1



I had a similar issue:


$ gem install rdoc
Fetching: 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.4
ERROR: 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:


compass


/home/myusername/.gem/ruby/2.5.0/bin


$PATH


$ gem install rdoc
Successfully installed rdoc-6.0.4
Parsing documentation for rdoc-6.0.4
Installing ri documentation for rdoc-6.0.4
Done installing documentation for rdoc after 3 seconds
1 gem installed






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Makefile test if variable is not empty

Will Oldham

'Series' object is not callable Error / Statsmodels illegal variable name