简体   繁体   中英

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.

When I try gem install qrencoder here is what I get:

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. I have qrencode-3.3.0 installed ok with brew but the gem install fails: any idea ?

when I type qrencode, here is what I get:

"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"

First install libqrencode via homebrew:

  brew install qrencode

Then try installing the gem again:

  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.

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

sudo apt-get install qrencode libqrencode-dev

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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