我有一个使用zbar进行条形码识别的rails应用程序。它在我的开发人员计算机上工作正常,但当我尝试将其部署到Heroku时,我的提交被拒绝,并显示以下消息:
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'
这是我的gemfile;
gem 'zbar', '~> 0.2.2'
我的/.buildpacks
:
https://github.com/ballantyne/heroku-buildpack-zbar
https://github.com/heroku/heroku-buildpack-ruby.git
为什么会这样?如何绕过它?
答案 0 :(得分:0)
请在您的控制台中尝试:
heroku config:set ZBAR_LIB=/app/vendor/lib/libzbar.so