1

运行 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 文件。

4

1 回答 1

0

在https://github.com/andys/qrscanner阅读 gem 的文档

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

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

* Python (for ZXing build script)
* ImageMagick: libMagick++, libMagickWand, libMagickCore
* gcc, g++, libstd++
* Operating system with a PREFIX of "/usr".
于 2013-06-24T19:06:53.020 回答