RVM-无法在Ubuntu 11.10上安装gem thrift

问题描述:

我使用Ubuntu 11.10和ruby 1.9.2

I use Ubuntu 11.10 and ruby 1.9.2

我无法在自己的机器上安装节俭的宝石

I can not install thrift gem on my machine

$ gem install thrift --no-ri --no-rdoc
Building native extensions.  This could take a while...
ERROR:  Error installing thrift:
    ERROR: Failed to build gem native extension.

        /home/sayuj/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for strlcpy() in string.h... no
creating Makefile

make
gcc -I. -I/home/sayuj/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-linux -I/home/sayuj/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/home/sayuj/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I.   -fPIC -g -O2 -Wall -Werror  -o thrift_native.o -c thrift_native.c
gcc -I. -I/home/sayuj/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-linux -I/home/sayuj/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/home/sayuj/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I.   -fPIC -g -O2 -Wall -Werror  -o memory_buffer.o -c memory_buffer.c
gcc -I. -I/home/sayuj/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-linux -I/home/sayuj/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/home/sayuj/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I.   -fPIC -g -O2 -Wall -Werror  -o struct.o -c struct.c
struct.c:28:1: error: static declaration of ‘strlcpy’ follows non-static declaration
/home/sayuj/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/missing.h:157:20: note: previous declaration of ‘strlcpy’ was here
make: *** [struct.o] Error 1


Gem files will remain installed in /home/sayuj/.rvm/gems/ruby-1.9.2-p290/gems/thrift-0.7.0 for inspection.
Results logged to /home/sayuj/.rvm/gems/ruby-1.9.2-p290/gems/thrift-0.7.0/ext/gem_make.out

出了什么问题以及如何解决?非常感谢您的支持.谢谢!

What went wrong and how to fix? All your support willbe highly appreciated. thanks!

我在Apache论坛上找到了对此问题的一些参考.那里似乎有一个补丁文件,您可以运行它来安装该节俭的gem.我检查了一下,看起来不错.

I found some references to this issue on an Apache forum. There is a patch file there that it looks like you can run in order to get the thrift gem to install. I checked it over and it looks sound.

您可以在这里找到它:

https://issues.apache.org/jira/browse/THRIFT-1382