2
votes

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"

2

2 Answers

3
votes

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.

0
votes

To install qrencode on ubuntu 12.04 run the command:--

sudo apt-get install qrencode libqrencode-dev