安装RubyGems的内部错误(初学者)

时间:2016-06-19 04:54:11

标签: ruby rubygems

我是编程的初学者。我从一本书中学习并在阅读关于RubyGems的部分时,它告诉我尝试安装一个名为feedtools的gem。使用Mac,所以我键入:sudo gem install feedtools(由于权限问题)

然后出现了这条长信息。

sudo gem install feedtools
Password:
Fetching: i18n-0.7.0.gem (100%)
Successfully installed i18n-0.7.0
Fetching: thread_safe-0.3.5.gem (100%)
Successfully installed thread_safe-0.3.5
Fetching: tzinfo-1.2.2.gem (100%)
Successfully installed tzinfo-1.2.2
Fetching: minitest-5.9.0.gem (100%)
Successfully installed minitest-5.9.0
Fetching: activesupport-4.2.6.gem (100%)
Successfully installed activesupport-4.2.6
Fetching: builder-3.2.2.gem (100%)
Successfully installed builder-3.2.2
Fetching: activemodel-4.2.6.gem (100%)
Successfully installed activemodel-4.2.6
Fetching: arel-6.0.3.gem (100%)
Successfully installed arel-6.0.3
Fetching: activerecord-4.2.6.gem (100%)
Successfully installed activerecord-4.2.6
Fetching: uuidtools-2.1.5.gem (100%)
Successfully installed uuidtools-2.1.5
Fetching: feedtools-0.2.29.gem (100%)

FeedTool's caching schema has changed to allow Feed objects to be
serialized to the cache.  This should offer some limited speed up
in some cases.

Successfully installed feedtools-0.2.29
Parsing documentation for i18n-0.7.0
Installing ri documentation for i18n-0.7.0
Parsing documentation for thread_safe-0.3.5
Installing ri documentation for thread_safe-0.3.5
Parsing documentation for tzinfo-1.2.2
Installing ri documentation for tzinfo-1.2.2
Parsing documentation for minitest-5.9.0
Installing ri documentation for minitest-5.9.0
Parsing documentation for activesupport-4.2.6
unable to convert "\x84" from ASCII-8BIT to UTF-8 for lib/active_support/values/unicode_tables.dat, skipping
Installing ri documentation for activesupport-4.2.6
Parsing documentation for builder-3.2.2
Installing ri documentation for builder-3.2.2
Parsing documentation for activemodel-4.2.6
Installing ri documentation for activemodel-4.2.6
Parsing documentation for arel-6.0.3
Installing ri documentation for arel-6.0.3
Parsing documentation for activerecord-4.2.6
Installing ri documentation for activerecord-4.2.6
Parsing documentation for uuidtools-2.1.5
Installing ri documentation for uuidtools-2.1.5
Parsing documentation for feedtools-0.2.29
unable to convert "\xA6" from ASCII-8BIT to UTF-8 for lib/feed_tools/vendor/html5/testdata/encoding/chardet/test_big5.txt, skipping
unable to convert "\xEF" from ASCII-8BIT to UTF-8 for lib/feed_tools/vendor/html5/testdata/encoding/tests1.dat, skipping
Before reporting this, could you check that the file you're documenting
has proper syntax:

  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -c lib/feed_tools/vendor/html5/testdata/sites/web-apps-old.htm

RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.

The internal error was:

(NoMethodError) undefined method `last' for nil:NilClass

ERROR:  While executing gem ... (NoMethodError)
    undefined method `last' for nil:NilClass

这是什么意思?我必须卸载宝石吗?我该如何正确安装?对不起,我是新来的,我担心我可能会做一些愚蠢的事情来搞砸而不能恢复。

提前致谢。

1 个答案:

答案 0 :(得分:0)

此错误仅与安装文档有关;您可以使用以下命令安装违规文档:

gem install feedtools --no-ri

但是,即使出现错误,gem代码本身也会成功安装:

➜  ~   gem list feedtools

*** LOCAL GEMS ***

feedtools (0.2.29)

我正在使用rvm来管理我的Unix用户空间中的rubies,这样我就不需要使用sudo了。这就是我没有指定sudo的原因。与其他人一样,我建议您使用rvmrbenv