使用此命令安装thrift_client
时:
sudo gem install thrift_client -v '0.7.1'
我收到此错误:
Building native extensions. This could take a while...
ERROR: Error installing thrift_client:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
checking for strlcpy() in string.h... no
creating Makefile
make
gcc -I. -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -Wall -Werror -o protocol.o -c protocol.c
gcc -I. -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -Wall -Werror -o struct.o -c struct.c
struct.c:28:1: ошибка: static-декларация «strlcpy» после неstatic-декларации
/usr/include/ruby-1.9.1/ruby/missing.h:157:20: замечание: здесь была предыдущая декларация «strlcpy»
make: *** [struct.o] Ошибка 1
Gem files will remain installed in /var/lib/gems/1.9.1/gems/thrift-0.7.0 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/thrift-0.7.0/ext/gem_make.out
怎么了?
我使用Ubuntu 11.10,Thrift 0.8.0,Rails 3,Ruby 1.9.3
答案 0 :(得分:2)
Thrift_client尚未将其thrift gem依赖更新为0.8.0,即基于ubuntu构建的版本。所以他们说... Update thrift pull request
我实际上通过克隆修复分支并自己构建和安装它来实现它:
git clone https://github.com/bitlove/thrift_client.git
cd thrift_client/
rake build
gem build thrift_client.gemspec
gem install thrift_client-0.7.2.gem