我对gbarcode gem有问题,它有依赖性gnu-barcode c应用程序。
当试图说gem install gbarcode
时说:
Building native extensions. This could take a while...
ERROR: Error installing gbarcode-linux:
ERROR: Failed to build gem native extension.
/home/user/.rvm/rubies/ruby-1.8.7-p357/bin/ruby extconf.rb
checking for main() in -lbarcode... yes
creating Makefile
make
gcc -I. -I. -I/home/user/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/x86_64-linux -I. -fPIC -g -O2 -fPIC -c barcode_wrap.c
gcc -shared -o gbarcode.so barcode_wrap.o -L. -L/home/user/.rvm/rubies/ruby-1.8.7-p357/lib -Wl,-R/home/user/.rvm/rubies/ruby-1.8.7-p357/lib -L. -rdynamic -Wl,-export-dynamic -Wl,-R -Wl,/home/user/.rvm/rubies/ruby-1.8.7-p357/lib -L/home/user/.rvm/rubies/ruby-1.8.7-p357/lib -lruby -lbarcode -lrt -ldl -lcrypt -lm -lc
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libbarcode.a(library.o): relocation R_X86_64_32 against `encodings' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libbarcode.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [gbarcode.so] Error 1
我尝试从ubuntu软件中心安装gnu-barcode应用程序,apt-get并直接从源http://www.gnu.org/software/barcode/安装,响应总是一样。
我应该如何安装gnu条形码以便它与gem一起使用。
是的,这个项目非常依赖于那个宝石,所以替换它对各方都会非常痛苦。