问题
I have a rails application which uses zbar for barcode recognition. It works fine on my developer machine, but when i tried to deploy it to Heroku my commit was rejected with the following message:
app/web.1: /app/vendor/bundle/ruby/2.0.0/gems/zbar-0.2.2/lib/zbar/lib.rb:12:in `rescue in <module:ZBar>': Didn't find libzbar on your system (LoadError)
app/web.1: Please install zbar (http://zbar.sourceforge.net/) or set ZBAR_LIB if it's in a weird place
app/web.1: FFI::Library::ffi_lib() failed with error: library names list must not be empty
app/web.1: from /app/vendor/bundle/ruby/2.0.0/gems/zbar-0.2.2/lib/zbar/lib.rb:9:in `<module:ZBar>'
app/web.1: from /app/vendor/bundle/ruby/2.0.0/gems/zbar-0.2.2/lib/zbar/lib.rb:1:in `<top (required)>'
app/web.1: from /app/vendor/bundle/ruby/2.0.0/gems/zbar-0.2.2/lib/zbar.rb:3:in `require'
app/web.1: from /app/vendor/bundle/ruby/2.0.0/gems/zbar-0.2.2/lib/zbar.rb:3:in `<top (required)>'
app/web.1: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `require'
app/web.1: from /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
Here is my gemfile;
gem 'zbar', '~> 0.2.2'
my /.buildpacks
:
https://github.com/ballantyne/heroku-buildpack-zbar
https://github.com/heroku/heroku-buildpack-ruby.git
Why does this happen? How to get around it?
回答1:
please try in your console:
heroku config:set ZBAR_LIB=/app/vendor/lib/libzbar.so
source: https://github.com/willglynn/ruby-zbar/issues/8
来源:https://stackoverflow.com/questions/24410511/heroku-zbar-didnt-find-libzbar-on-your-system-loaderror