【问题标题】:Cannot install qrscanner gem on ubuntu无法在 ubuntu 上安装 qrscanner gem
【发布时间】:2013-06-21 07:42:17
【问题描述】:

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

【问题讨论】:

    标签: ruby gem ubuntu-12.04 qr-code


    【解决方案1】:

    阅读 gem 的文档 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".
    

    【讨论】:

      猜你喜欢
      • 2014-10-20
      • 2013-01-06
      • 2013-08-20
      • 2011-12-19
      • 2012-11-20
      • 2017-12-17
      • 1970-01-01
      • 2019-10-27
      • 2015-04-06
      相关资源
      最近更新 更多