问题描述
由于奇怪的构建错误,我无法安装'iconv'gem。
我从源代码构建'libiconv'并将.h和.dylib链接到rvm的include和lib目录。
当我运行时
gem install iconv
Gem输出奇怪的构建错误:
构建本机扩展。这可能需要一段时间...
$ p $ 错误:安装iconv时出错:
错误:无法构建gem原生扩展。
/Users/myusername/.rvm/rubies/ruby-1.9.2-rc2/bin/ruby extconf.rb
在iconv.h中检查iconv()... no
检查iconv()in -liconv ...是
检查iconv的const()第二个参数... no
创建Makefile
make
gcc -I。 -I / Users / myusername / .rvm / rubies / ruby-1.9.2-rc2 / include / ruby-1.9.1 / x86_64-darwin10.4.0 -I / Users / myusername / .rvm / rubies / ruby-1.9.2 -rc2 / include / ruby-1.9.1 / ruby / backward -I / Users / myusername / .rvm / rubies / ruby-1.9.2-rc2 / include / ruby-1.9.1 -I。 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno -unused-parameter -Wno-括弧-Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno -long-long -fno-common -pipe -o iconv.o -c iconv.c
从iconv.c包含的文件中:21:
/Users/myusername/.rvm/rubies/ruby- 1.9.2-rc2 / include / ruby-1.9.1 / ruby / backward / st.h:2:2:警告:#warning使用ruby / st.h而不是裸露的st.h
iconv.c:22:20:error:intern.h:没有这样的文件或目录
iconv.c:在函数'map_charset'中:
iconv.c:139:错误:'struct RHash'has没有成员名为'tbl'
iconv.c:139:错误:'struct RHash'没有名为'tbl'的成员
iconv.c:142:错误:'struct RHash'没有名为' tbl'
iconv.c:在函数'iconv_create'中:
iconv.c:187:错误:'struct RString'没有名为'len'的成员
iconv.c:188:error :'struct RString'没有名为'len'的成员
iconv.c:190:错误:'struct RS tring'没有名为'ptr'的成员
iconv.c:190:错误:'struct RString'没有名为'ptr'的成员
iconv.c:190:错误:'struct RString'has no名为'ptr'的成员
iconv.c:190:错误:'struct RString'没有名为'ptr'的成员
iconv.c:192:error:'struct RString'has no member named'ptr '
iconv.c:193:错误:'struct RString'没有名为'len'的成员
iconv.c:函数'iconv_fail':
iconv.c:328:错误: 'struct RString'没有名为'len'的成员
iconv.c:在函数'iconv_fail_retry'中:
iconv.c:352:错误:'ruby_errinfo'未声明(在此函数中首次使用)
iconv.c:352:error:(每个未声明的标识符只报告一次
iconv.c:352:错误:对于它显示的每个函数)
iconv.c:函数'rb_str_derive ':
iconv.c:371:error:'struct RString'has no members named'ptr'
iconv.c:371:error:'struct RString'has no member named'l en'
iconv.c:373:错误:'struct RString'没有名为'ptr'的成员
iconv.c:373:错误:'struct RString'没有名为'len'的成员
iconv.c:374:error:'struct RString'has no member named'ptr'
iconv.c:In function'iconv_convert':
iconv.c:418:error:'struct RArray '没有名为'len'的成员
iconv.c:418:错误:'struct RArray'没有名为'ptr'的成员
iconv.c:436:错误:'struct RString'has no member命名为'len'
iconv.c:437:错误:'struct RString'没有名为'ptr'的成员
iconv.c:455:警告:无符号表达式的比较> = 0始终为真
iconv.c:458:警告:已签名和未签名之间的比较
iconv.c:459:警告:已签名和未签名之间的比较
iconv.c:491:警告:隐式转换缩短64位值转换为32位值
iconv.c:494:警告:隐式转换将64位值缩短为32位值
iconv.c:497:错误:'struct RArray'没有名为'len'的成员
iconv.c:498:错误:'struct RArray'没有名为'ptr'的成员
iconv.c:499:错误:'struct RArray '没有名为'ptr'的成员
iconv.c:501:错误:'struct RString'没有名为'len'的成员
iconv.c:502:错误:'struct RString'has no member命名'ptr'
iconv.c:514:警告:隐式转换将64位值缩短为32位值
iconv.c:在函数'iconv_s_convert'中:
iconv.c :615:error:'struct RString'has no member named'len'
make:*** [iconv.o]错误1
Gem文件将保持安装状态/Users/myusername/.rvm/gems/ruby-1.9.2-rc2/gems/iconv-0.1进行检查。
结果记录到/Users/myusername/.rvm/gems/ruby-1.9.2-rc2/gems/iconv-0.1/ext/iconv/gem_make.out
如何安装并正确构建。
谢谢
我想我找到了原因!
看起来像Iconv gem还不符合1.9.x标准,所以它不会生成。
I fail to install the 'iconv' gem, because of weird build errors.
I have build the 'libiconv' from source and linked the .h and .dylib into the rvm's include and lib directory.When I run
gem install iconv
Gem outputs strange build errors:
Building native extensions. This could take a while...
ERROR: Error installing iconv:
ERROR: Failed to build gem native extension.
/Users/myusername/.rvm/rubies/ruby-1.9.2-rc2/bin/ruby extconf.rb
checking for iconv() in iconv.h... no
checking for iconv() in -liconv... yes
checking for const of iconv() 2nd argument... no
creating Makefile
make
gcc -I. -I/Users/myusername/.rvm/rubies/ruby-1.9.2-rc2/include/ruby-1.9.1/x86_64-darwin10.4.0 -I/Users/myusername/.rvm/rubies/ruby-1.9.2-rc2/include/ruby-1.9.1/ruby/backward -I/Users/myusername/.rvm/rubies/ruby-1.9.2-rc2/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -o iconv.o -c iconv.c
In file included from iconv.c:21:
/Users/myusername/.rvm/rubies/ruby-1.9.2-rc2/include/ruby-1.9.1/ruby/backward/st.h:2:2: warning: #warning use "ruby/st.h" instead of bare "st.h"
iconv.c:22:20: error: intern.h: No such file or directory
iconv.c: In function ‘map_charset’:
iconv.c:139: error: ‘struct RHash’ has no member named ‘tbl’
iconv.c:139: error: ‘struct RHash’ has no member named ‘tbl’
iconv.c:142: error: ‘struct RHash’ has no member named ‘tbl’
iconv.c: In function ‘iconv_create’:
iconv.c:187: error: ‘struct RString’ has no member named ‘len’
iconv.c:188: error: ‘struct RString’ has no member named ‘len’
iconv.c:190: error: ‘struct RString’ has no member named ‘ptr’
iconv.c:190: error: ‘struct RString’ has no member named ‘ptr’
iconv.c:190: error: ‘struct RString’ has no member named ‘ptr’
iconv.c:190: error: ‘struct RString’ has no member named ‘ptr’
iconv.c:192: error: ‘struct RString’ has no member named ‘ptr’
iconv.c:193: error: ‘struct RString’ has no member named ‘len’
iconv.c: In function ‘iconv_fail’:
iconv.c:328: error: ‘struct RString’ has no member named ‘len’
iconv.c: In function ‘iconv_fail_retry’:
iconv.c:352: error: ‘ruby_errinfo’ undeclared (first use in this function)
iconv.c:352: error: (Each undeclared identifier is reported only once
iconv.c:352: error: for each function it appears in.)
iconv.c: In function ‘rb_str_derive’:
iconv.c:371: error: ‘struct RString’ has no member named ‘ptr’
iconv.c:371: error: ‘struct RString’ has no member named ‘len’
iconv.c:373: error: ‘struct RString’ has no member named ‘ptr’
iconv.c:373: error: ‘struct RString’ has no member named ‘len’
iconv.c:374: error: ‘struct RString’ has no member named ‘ptr’
iconv.c: In function ‘iconv_convert’:
iconv.c:418: error: ‘struct RArray’ has no member named ‘len’
iconv.c:418: error: ‘struct RArray’ has no member named ‘ptr’
iconv.c:436: error: ‘struct RString’ has no member named ‘len’
iconv.c:437: error: ‘struct RString’ has no member named ‘ptr’
iconv.c:455: warning: comparison of unsigned expression >= 0 is always true
iconv.c:458: warning: comparison between signed and unsigned
iconv.c:459: warning: comparison between signed and unsigned
iconv.c:491: warning: implicit conversion shortens 64-bit value into a 32-bit value
iconv.c:494: warning: implicit conversion shortens 64-bit value into a 32-bit value
iconv.c:497: error: ‘struct RArray’ has no member named ‘len’
iconv.c:498: error: ‘struct RArray’ has no member named ‘ptr’
iconv.c:499: error: ‘struct RArray’ has no member named ‘ptr’
iconv.c:501: error: ‘struct RString’ has no member named ‘len’
iconv.c:502: error: ‘struct RString’ has no member named ‘ptr’
iconv.c:514: warning: implicit conversion shortens 64-bit value into a 32-bit value
iconv.c: In function ‘iconv_s_convert’:
iconv.c:615: error: ‘struct RString’ has no member named ‘len’
make: *** [iconv.o] Error 1
Gem files will remain installed in /Users/myusername/.rvm/gems/ruby-1.9.2-rc2/gems/iconv-0.1 for inspection.
Results logged to /Users/myusername/.rvm/gems/ruby-1.9.2-rc2/gems/iconv-0.1/ext/iconv/gem_make.out
How do I make it install and build properly.
Thanks
I think I have found out why !Looks like the Iconv gem is not yet 1.9.x compliant, so it will not build.
这篇关于未能在ruby 1.9.2上构建iconv gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!