Ruby 无法在ubuntu上安装qrscanner gem

Ruby 无法在ubuntu上安装qrscanner gem,ruby,gem,ubuntu-12.04,qr-code,Ruby,Gem,Ubuntu 12.04,Qr Code,运行gem安装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

运行gem安装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文件在上述两个位置都不存在

阅读gem的文档,网址为

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

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

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