【问题标题】:install qrencoder gem on osx for ruby on rails project在 osx 上为 ruby​​ on rails 项目安装 qrencoder gem
【发布时间】:2012-05-29 04:57:41
【问题描述】:

我正在尝试在我的 mac osx 10.7.4 上安装 qrencoder gem,以便在 ruby​​ on rails 项目中使用。

当我尝试 gem install qrencoder 时,我得到了:

ERROR: Error installing qrencoder: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb checking for qrencode.h... yes checking for QRinput_new() in -lqrencode... 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.

mkmf.log 文件除了上述内容外没有任何内容。 我已经用 brew 安装了 qrencode-3.3.0,但 gem 安装失败:有什么想法吗?

当我输入 qrencode 时,我得到的是:

“dyld:库未加载:/usr/local/lib/libqrencode.3.dylib 引用自:/usr/local/bin/qrencode 原因:库版本不兼容:qrencode需要7.0.0或更高版本,但libqrencode.3.dylib提供5.0.0版本 跟踪/BPT 陷阱:5"

【问题讨论】:

    标签: ruby-on-rails macos gem installation


    【解决方案1】:

    要在 ubuntu 12.04 上安装 qrencode,请运行以下命令:--

    sudo apt-get install qrencode libqrencode-dev
    

    【讨论】:

    • 我的问题是关于 OSX,而​​不是 ubuntu。
    • 是的,我在 ubuntu 上遇到过这个问题,其他解决方案对我不起作用,这个答案解决了我,所以我认为这可能对其他人有所帮助。
    【解决方案2】:

    首先通过 homebrew 安装 libqrencode:

      brew install qrencode
    

    然后尝试再次安装 gem:

      gem install qrencoder
    

    如果您没有自制软件和/或希望从源代码编译,https://github.com/harrisj/qrencoder 有更详细的说明。

    【讨论】:

    • Ubuntu:sudo apt-get install qrencode libqrencode-dev
    • brew install qrencode 运行良好。问题在于 gem install qrencoder。
    猜你喜欢
    • 2011-07-21
    • 2014-06-21
    • 1970-01-01
    • 2012-02-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-16
    相关资源
    最近更新 更多