简体   繁体   English

在osx上安装qrencoder gem for ruby​​ on rails项目

[英]install qrencoder gem on osx for ruby on rails project

I am trying to install the qrencoder gem on my mac osx 10.7.4 to use in a ruby on rails project. 我试图在我的mac osx 10.7.4上安装qrencoder gem以在rails项目中使用ruby。

When I try gem install qrencoder here is what I get: 当我尝试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.

The mkmf.log file does not say anything other than the above. mkmf.log文件除上述内容外没有其他任何内容。 I have qrencode-3.3.0 installed ok with brew but the gem install fails: any idea ? 我用qrencode-3.3.0安装好了brew但是gem安装失败了:任何想法?

when I type qrencode, here is what I get: 当我输入qrencode时,这是我得到的:

"dyld: Library not loaded: /usr/local/lib/libqrencode.3.dylib Referenced from: /usr/local/bin/qrencode Reason: Incompatible library version: qrencode requires version 7.0.0 or later, but libqrencode.3.dylib provides version 5.0.0 Trace/BPT trap: 5" “dyld:未加载库:/usr/local/lib/libqrencode.3.dylib引自:/ usr / local / bin / qrencode原因:不兼容的库版本:qrencode需要7.0.0或更高版本,但是libqrencode.3。 dylib提供版本5.0.0跟踪/ BPT陷阱:5“

First install libqrencode via homebrew: 首先通过自制软件安装libqrencode:

  brew install qrencode

Then try installing the gem again: 然后再次尝试安装gem:

  gem install qrencoder

There are more detailed instructions at https://github.com/harrisj/qrencoder if you don't have homebrew and/or would prefer to compile from source. 如果您没有自制软件和/或更愿意从源代码编译,请在https://github.com/harrisj/qrencoder上提供更详细的说明。

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

sudo apt-get install qrencode libqrencode-dev

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM