在mac 10.9上安装错误的gem install qrencoder

时间:2014-04-03 00:45:40

标签: ruby gem

我的操作系统是mac 10.9.2,ruby是2.0。

我已经使用brew install qrencode,但是当我运行gem install qrencoder时,它仍然有错误。

我列出了我的术语输出。

ZhouQi:git zhouqi$ gem install qrencoder
Building native extensions.  This could take a while...
ERROR:  Error installing qrencoder:
    ERROR: Failed to build gem native extension.

    /Users/zhouqi/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for qrencode.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/zhouqi/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
    --with-qrencoder-dir
    --without-qrencoder-dir
    --with-qrencoder-include
    --without-qrencoder-include=${qrencoder-dir}/include
    --with-qrencoder-lib
    --without-qrencoder-lib=${qrencoder-dir}/


Gem files will remain installed in /Users/zhouqi/.rvm/gems/ruby-2.0.0-p247/gems/qrencoder-1.4.1 for inspection.
Results logged to /Users/zhouqi/.rvm/gems/ruby-2.0.0-p247/gems/qrencoder-1.4.1/ext/qrencoder_ext/gem_make.out

2 个答案:

答案 0 :(得分:0)

我使用此命令安装成功。

gem install qrencoder -- --with-qrencoder-include=/usr/local/Cellar/qrencode/3.4.2/include --with-qrencoder-lib=/usr/local/Cellar/qrencode/3.4.2/lib

答案 1 :(得分:0)

我遇到了同样的错误,但确实如此:

MacBook-Pro: develop$ cd /
MacBook-Pro:/$ cd usr/local/Cellar/qrencode/3.4.3_1/
COPYING               INSTALL_RECEIPT.json  README                bin/                   lib/
ChangeLog             NEWS                  TODO                  include/               share/
MacBook-Pro:/$ cd usr/local/Cellar/qrencode/3.4.3_1/
COPYING               INSTALL_RECEIPT.json  README                bin/                  lib/
ChangeLog             NEWS                  TODO                  include/              share/ 
MacBook-Pro:/$ z bitspark
MacBook-Pro:$ cd bitspark
MacBook-Pro:$ sudo gem install qrencoder -- --  with-qrencoder-include=/usr/local/Cellar/qrencode/3.4.3_1/include --with-qrencoder-lib=/usr/local/Cellar/qrencode/3.4.3_1/lib

在运行gem install qrencoder之前,您应该将qrencode版本替换为已安装的版本。

希望这有帮助!