安装新的Ruby gem时,RDoc :: TopLevel:Class的未定义方法“重置" [英] undefined method `reset' for RDoc::TopLevel:Class when installing a new Ruby gem
问题描述
例如,
$ 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
当我安装任何新的gem时,都会继续引发NoMethodError异常.我在Google上进行了搜索,并在RDoc和RubyGems GitHub存储库中搜索了问题,但是没有运气.
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.
我的Ruby版本是
$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
RubyGems版本是
The RubyGems version is
$ gem -v
2.5.1
已安装的RDoc版本是
The installed RDoc version is
$ gem search rdoc -l
*** LOCAL GEMS ***
rdoc (4.2.2, 4.2.1)
我在Mac OS X El Capitan上安装了带有RVM的Ruby.
I installed Ruby with RVM on Mac OS X El Capitan.
谢谢!
[UPDATE] 2018/08/03
我已经很长时间没有使用Macbook了,所以直到现在我都忘记了这个问题.前天我收到了答复通知,今天我用同一台Macbook检查了情况.我发现我不再遇到问题了,Ruby和Gems的更新如下:
I haven't used my Macbook for long time, so I forgot the problem until now. The day before yesterday I got an answer notification and today I checked my situation with the same Macbook. I found that I no longer have the problem and the Ruby and Gems were updated as follows:
$ gem install netaddr
Fetching: netaddr-2.0.3.gem (100%)
Successfully installed netaddr-2.0.3
Parsing documentation for netaddr-2.0.3
Installing ri documentation for netaddr-2.0.3
Done installing documentation for netaddr after 1 seconds
1 gem installed
$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin15]
$ gem -v
2.6.8
$ gem search rdoc -l
*** LOCAL GEMS ***
rdoc (default: 5.0.0)
我不记得我何时更新它们,但是问题仍然存在,我猜想这是一个错误并已在更新中修复.
I don't remember when I updated them, but the problem has gone anyway, I guessed it was a bug and fixed in the updates.
谢谢.
推荐答案
在安装rdoc时,它将尝试使用rdoc生成自己的文档.二进制文件已安装(可能在/usr/bin中),但是在gem安装时将找不到该二进制文件-如果这是第一次. gem install rdoc --no-document
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
这篇关于安装新的Ruby gem时,RDoc :: TopLevel:Class的未定义方法“重置"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!