rubygems 1.3.7 TypeError(在'合并')在Ubuntu上安装 [英] rubygems 1.3.7 TypeError (in 'merge') during installation on Ubuntu

查看:108
本文介绍了rubygems 1.3.7 TypeError(在'合并')在Ubuntu上安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用rvm在更新的Ubunutu x86_64上安装ruby-1.9.2-p0时,我在merge中遇到错误:无法将String转换为Hash(TypeError)。已经安装了rvm笔记中的所有apt软件包和rubygems手册中的apt软件包。我相信这个错误是在RVM试图安装rubygems时产生的。



我也遇到了与系统ruby安装ruby gem相同的错误。我认为这是一个依赖性问题。



之前我已经在Ubuntu上编译过i386和x86_64,并且从未遇到过这个问题。通过系统红宝石:

  
$ 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':无法将String转换为Hash(TypeError)
from ./lib/rubygems/config_file.rb:172:in`initialize'
from ./ lib / ruby​​gems.rb:385:`new'
from ./lib/rubygems.rb:385:in`configuration'
from ./lib/rubygems.rb:635:in`path'来自./lib/rubygems/source_index.rb:68:b的
:来自./lib/rubygems/source_index.rb:58:in的installed_spec_directories'
来自./lib的from_installed_gems'
/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 `初始化'
from ./lib/rubygems.rb:841:in`new'
from ./lib/rubygems.rb:841:in`searcher'
from ./lib/ rubygems.rb: 840:在`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:`require'
from setup.rb :24

通过RVM:

<$ p $使
file.c:在函数'file_expand_path'中:
file.c:2844:警告:
[2010-09-20 10:46:27] make
file.c: :'b'可能在此函数中未初始化使用
io.c:在函数'argf_next_argv'中:
io.c:6821:warning:忽略'fchown'的返回值,用属性warn_unused_result声明
process.c:在函数'rb_fork_err'中:
process.c:2516:warning:忽略'write'的返回值,用属性声明warn_unused_result
process.c:2519:warning:ignore 'write'的返回值,用属性声明warn_unused_result
process.c:在函数'p_uid_change_privilege'中:
process.c:4111:警告:条件表达式中的signed和unsigned类型
process.c:4112:警告:条件表达式中的signed和unsigned类型
process.c:4113:warning:signed和无符号类型的条件表达式
process.c:在函数'proc_daemon'中:
process.c:4608:warning:忽略'chdir'的返回值,用属性warn_unused_result
声明。 c:在函数'p_gid_change_privilege'中:
process.c:4730:警告:条件表达式中的signed和unsigned类型
process.c:4731:警告:条件表达式中的signed和unsigned类型
process.c:4732:警告:条件表达式中的signed和unsigned类型
random.c:函数'fill_random_seed':
random.c:492:warning:忽略'read'的返回值,声明具有属性warn_unused_result
ossl_pkey_ec.c:函数'ossl_ec_group_set_seed':
ossl_pkey_ec.c:1110:警告:signed和unsigned int之间的比较eger表达式
ossl_pkcs7.c:函数'ossl_pkcs7_sym2typeid':
ossl_pkcs7.c:376:警告:有符号和无符号整数表达式之间的比较
ossl_hmac.c:函数'ossl_hmac_hexdigest':
ossl_hmac.c:162:警告:有符号和无符号整数表达式之间的比较
ossl_hmac.c:函数'ossl_hmac_s_hexdigest':
ossl_hmac.c:225:警告:有符号和无符号整数之间的比较表达式
ossl_ssl_session.c:在函数'ossl_ssl_session_to_der'中:
ossl_ssl_session.c:208:警告:有符号和无符号整数表达式之间的比较
parser.c:在函数'parse'中:
parser.c:58:warning:'internal_enc'可能在这个函数中未初始化使用
pty.c:在函数'chfunc'中:
pty.c:209:warning:忽略返回值'write',用属性warn_unused_result
pty.c声明:在函数'establishShell'中:
pty.c:269:warning:忽略返回值读取',用属性声明warn_unused_result
_sdbm.c:函数'makroom'中:
_sdbm.c:425:warning:忽略'write'的返回值,用属性声明warn_unused_result
_sdbm .c:在函数'chkpage'中:
_sdbm.c:864:警告:有符号和无符号整数表达式之间的比较
ruby​​ext.c:函数'mktime_do':
ruby​​ext.c: 278:警告:有符号和无符号整数表达式之间的比较
/home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems/config_file.rb:159:in`merge':can' t将String转换为Hash(TypeError)
从/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从'/ home / deploy / .rvm / src / ruby​​-1.9.2'中的'new'
-p0 / lib / ruby​​gems.rb:390:在'configuration'中
从/home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems.rb:618:in'path'来自/home/deploy/.rvm/src/ruby-1.9.2-p0/li的
b / ruby​​gems / source_index.rb:68:在`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:在`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 searchcher'
from:10:in`synchronize'
from / home / deploy / .rvm / src / ruby​​-1.9.2-p0 / lib / ruby​​gems.rb:823:在`searcher'中
来自/home/deploy/.rvm/src/ruby-1.9.2- p0 / lib / ruby​​gems.rb:484:在`find_files'
from /home/deploy/.rvm/src/ruby-1.9.2-p0/lib/rubygems.rb:966:in`load_plugins'$ b / b from /home/deploy/.rvm/src/ruby-1.9.2- p0 / lib / ruby​​gems.rb:1136:在''
从:29:在'require'
从:29:在'require'
从/home/deploy/.rvm/ src / ruby​​-1.9.2-p0 / lib / rdoc / rdoc.rb:438:在''
从:29:在'require'
从:29:在'require'
from ./bin/rdoc:11:in`'
make:*** [rdoc]错误1


<解决方案很简单。



1)阅读源代码。
2)意识到system_config合并成功。
3)意识到你的user_config(.gemrc文件)有错误。
4)修复它。
5)一切正常。



.gemrc正确的语法:

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


While installing ruby-1.9.2-p0 with rvm on an updated Ubunutu x86_64, I keep getting an error in `merge': can't convert String into Hash (TypeError). All apt packages in rvm notes and those found in the rubygems manual have been installed. I believe the error is resulting when RVM is attempting to install rubygems.

I also get the same error installing ruby gems with the system ruby. I think this is a dependency problem.

I have compiled on Ubuntu before on both i386 and x86_64 before and never run into this issue. What am I missing/doing wrong?

Via system 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

Via 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

解决方案

The solution was simple.

1) Read the source code. 2) Realize that the system_config merge succeeds. 3) Realize you have an error in your user_config (.gemrc file). 4) Fix it. 5) Everything works.

.gemrc correct syntax:

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

这篇关于rubygems 1.3.7 TypeError(在'合并')在Ubuntu上安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆