rubygems 1.3.7在Ubuntu上安装时出现类型错误(在'merge')。[英] rubygems 1.3.7 TypeError (in 'merge') during installation on Ubuntu

本文是小编为大家收集整理的关于rubygems 1.3.7在Ubuntu上安装时出现类型错误(在'merge')。的处理方法,想解了rubygems 1.3.7在Ubuntu上安装时出现类型错误(在'merge')。的问题怎么解决?rubygems 1.3.7在Ubuntu上安装时出现类型错误(在'merge')。问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

在更新的ubunutu x86_64上安装带有RVM的Ruby-1.9.2-P0时,我一直在" Merge"中遇到错误:无法将字符串转换为Hash(TypeError). RVM注释中的所有APT软件包以及RubyGems手册中的所有APT软件包均已安装.我相信当RVM试图安装RubyGems时,错误是错误的.

我还会与系统Ruby一起安装Ruby Gems也会遇到相同的错误.我认为这是一个依赖性问题.

我之前曾在i386和x86_64上都在ubuntu上编译,但从未遇到这个问题.我想念/做错了什么?

通过系统Ruby:

$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
$ sudo ruby setup.rb 
./lib/rubygems/config_file.rb:172:in `merge': can't convert String into Hash (TypeError)
    from ./lib/rubygems/config_file.rb:172:in `initialize'
    from ./lib/rubygems.rb:385:in `new'
    from ./lib/rubygems.rb:385:in `configuration'
    from ./lib/rubygems.rb:635:in `path'
    from ./lib/rubygems/source_index.rb:68:in `installed_spec_directories'
    from ./lib/rubygems/source_index.rb:58:in `from_installed_gems'
    from ./lib/rubygems.rb:883:in `source_index'
    from ./lib/rubygems/gem_path_searcher.rb:81:in `init_gemspecs'
    from ./lib/rubygems/gem_path_searcher.rb:13:in `initialize'
    from ./lib/rubygems.rb:841:in `new'
    from ./lib/rubygems.rb:841:in `searcher'
    from ./lib/rubygems.rb:840:in `synchronize'
    from ./lib/rubygems.rb:840:in `searcher'
    from ./lib/rubygems.rb:479:in `find_files'
    from ./lib/rubygems.rb:983:in `load_plugins'
    from ./lib/rubygems.rb:1139
    from setup.rb:24:in `require'
    from setup.rb:24

通过RVM:

[2010-09-20 10:46:27] make 
file.c: In function 'file_expand_path':
file.c:2844: warning: 'b' may be used uninitialized in this function
io.c: In function 'argf_next_argv':
io.c:6821: warning: ignoring return value of 'fchown', declared with attribute warn_unused_result
process.c: In function 'rb_fork_err':
process.c:2516: warning: ignoring return value of 'write', declared with attribute warn_unused_result
process.c:2519: warning: ignoring return value of 'write', declared with attribute warn_unused_result
process.c: In function 'p_uid_change_privilege':
process.c:4111: warning: signed and unsigned type in conditional expression
process.c:4112: warning: signed and unsigned type in conditional expression
process.c:4113: warning: signed and unsigned type in conditional expression
process.c: In function 'proc_daemon':
process.c:4608: warning: ignoring return value of 'chdir', declared with attribute warn_unused_result
process.c: In function 'p_gid_change_privilege':
process.c:4730: warning: signed and unsigned type in conditional expression
process.c:4731: warning: signed and unsigned type in conditional expression
process.c:4732: warning: signed and unsigned type in conditional expression
random.c: In function 'fill_random_seed':
random.c:492: warning: ignoring return value of 'read', declared with attribute warn_unused_result
ossl_pkey_ec.c: In function 'ossl_ec_group_set_seed':
ossl_pkey_ec.c:1110: warning: comparison between signed and unsigned integer expressions
ossl_pkcs7.c: In function 'ossl_pkcs7_sym2typeid':
ossl_pkcs7.c:376: warning: comparison between signed and unsigned integer expressions
ossl_hmac.c: In function 'ossl_hmac_hexdigest':
ossl_hmac.c:162: warning: comparison between signed and unsigned integer expressions
ossl_hmac.c: In function 'ossl_hmac_s_hexdigest':
ossl_hmac.c:225: warning: comparison between signed and unsigned integer expressions
ossl_ssl_session.c: In function 'ossl_ssl_session_to_der':
ossl_ssl_session.c:208: warning: comparison between signed and unsigned integer expressions
parser.c: In function 'parse':
parser.c:58: warning: 'internal_enc' may be used uninitialized in this function
pty.c: In function 'chfunc':
pty.c:209: warning: ignoring return value of 'write', declared with attribute warn_unused_result
pty.c: In function 'establishShell':
pty.c:269: warning: ignoring return value of 'read', declared with attribute warn_unused_result
_sdbm.c: In function 'makroom':
_sdbm.c:425: warning: ignoring return value of 'write', declared with attribute warn_unused_result
_sdbm.c: In function 'chkpage':
_sdbm.c:864: warning: comparison between signed and unsigned integer expressions
rubyext.c: In function 'mktime_do':
rubyext.c:278: warning: comparison between signed and unsigned integer expressions
/home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems/config_file.rb:159:in `merge': can't convert String into Hash (TypeError)
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems/config_file.rb:159:in `initialize'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems.rb:390:in `new'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems.rb:390:in `configuration'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems.rb:618:in `path'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems/source_index.rb:68:in `installed_spec_directories'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems/source_index.rb:58:in `from_installed_gems'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems.rb:866:in `source_index'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems/gem_path_searcher.rb:81:in `init_gemspecs'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems/gem_path_searcher.rb:13:in `initialize'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems.rb:824:in `new'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems.rb:824:in `block in searcher'
    from :10:in `synchronize'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems.rb:823:in `searcher'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems.rb:484:in `find_files'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems.rb:966:in `load_plugins'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems.rb:1136:in `'
    from :29:in `require'
    from :29:in `require'
    from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rdoc/rdoc.rb:438:in `'
    from :29:in `require'
    from :29:in `require'
    from ./bin/rdoc:11:in `'
make: *** [rdoc] Error 1

推荐答案

解决方案很简单.

1)读取源代码. 2)意识到System_Config合并成功. 3)意识到您的user_config(.gemrc文件)中有错误. 4)修复它. 5)一切都起作用.

.gemrc正确的语法:

gem: --no-ri --no-rdoc

本文地址:https://www.itbaoku.cn/post/786759.html