无法在ubuntu上安装qrscanner gem

时间:2013-06-24 17:39:47

标签: ruby gem ubuntu-12.04 qr-code

运行gem install qrscanner时,我遇到以下错误:

Building native extensions.  This could take a while...
ERROR:  Error installing qrscanner:
ERROR: Failed to build gem native extension.

    /home/kasuka/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb

make
pwd ; cd zxing ; python scons/scons.py lib DEBUG=0 PIC=1
/home/kasuka/.rvm/gems/ruby-1.9.2-p320/gems/qrscanner-0.4.1/ext/qrscanner
scons: Reading SConscript files ...

scons: warning: Two different environments were specified for target magick/src/MagickBitmapSource.o,
    but they appear to have the same action: $CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES

但是当我添加sudo时:

Building native extensions.  This could take a while...
ERROR:  Error installing qrscanner:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
extconf.rb:4: Use RbConfig instead of obsolete and deprecated Config.

make
pwd ; cd zxing ; python scons/scons.py lib DEBUG=0 PIC=1
/var/lib/gems/1.9.1/gems/qrscanner-0.4.1/ext/qrscanner
scons: Reading SConscript files ...

scons: warning: Two different environments were specified for target magick/src/MagickBitmapSource.o,
    but they appear to have the same action: $CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES

我正在使用ruby 1.9.2,值得一提的是,extconf.rb文件在所提到的位置都不存在。

1 个答案:

答案 0 :(得分:0)

  

阅读宝石的文档   https://github.com/andys/qrscanner

     

并在安装gem之前安装这些依赖项。

Dependencies
------------

* Python (for ZXing build script)
* ImageMagick: libMagick++, libMagickWand, libMagickCore
* gcc, g++, libstd++
* Operating system with a PREFIX of "/usr".