【问题标题】:gem install qrencoder with error on mac 10.9gem 在 mac 10.9 上安装 qrencoder 时出错
【发布时间】:2014-04-03 00:45:39
【问题描述】:

我的操作系统是 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

【问题讨论】:

  • 您是否查看了“记录到...的结果”中链接的文件?
  • @tadman 我看文件,内容是一样的。

标签: ruby gem


【解决方案1】:

我用这个推荐安装成功。

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

【讨论】:

    【解决方案2】:

    我遇到了同样的错误,但我这样做了:

    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 版本替换为您安装的版本。

    希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 2013-12-01
      • 2013-11-15
      • 1970-01-01
      • 1970-01-01
      • 2016-01-01
      • 1970-01-01
      • 2015-03-19
      • 2014-11-19
      • 2012-05-29
      相关资源
      最近更新 更多