Ruby on rails ZXing/FFI/Gem导致推送到Heroku时出错
我目前正在做一个项目,需要ZXing gem来解码条形码图像。在我尝试在本地安装gem时,我遇到了一些依赖关系方面的复杂问题,但是通过添加ffi和spoon解决了这些问题http://rubygems.org/gems/spoon 除了jruby JAR之外,我的Gemfile中还有gems。现在,我的本地机器——iMac和MacBook Pro——都运行着Lion——一切正常。但是,当我尝试将应用程序推送到Heroku时,终端会在以下线路上挂起几分钟:Ruby on rails ZXing/FFI/Gem导致推送到Heroku时出错,ruby-on-rails,heroku,gem,zxing,ffi,Ruby On Rails,Heroku,Gem,Zxing,Ffi,我目前正在做一个项目,需要ZXing gem来解码条形码图像。在我尝试在本地安装gem时,我遇到了一些依赖关系方面的复杂问题,但是通过添加ffi和spoon解决了这些问题http://rubygems.org/gems/spoon 除了jruby JAR之外,我的Gemfile中还有gems。现在,我的本地机器——iMac和MacBook Pro——都运行着Lion——一切正常。但是,当我尝试将应用程序推送到Heroku时,终端会在以下线路上挂起几分钟: -----> Writing co
-----> Writing config/database.yml to read from DATABASE_URL
然后,最后给出了错误消息:
/app/slug-compiler/lib/utils.rb:62:in `block (2 levels) in spawn': command='/app/slug-compiler/lib/../buildpacks/ruby/bin/compile /tmp/build_31wo219fllz4d /app/tmp/repo.git/.cache' exit_status=0 out='' event=timeout elapsed=581.3388702869415 (Utils::TimeoutError)
from /app/slug-compiler/lib/utils.rb:48:in `loop'
from /app/slug-compiler/lib/utils.rb:48:in `block in spawn'
from /app/slug-compiler/lib/utils.rb:44:in `popen'
from /app/slug-compiler/lib/utils.rb:44:in `spawn'
from /app/slug-compiler/lib/buildpack.rb:35:in `block in compile'
from /app/slug-compiler/lib/buildpack.rb:33:in `fork'
from /app/slug-compiler/lib/buildpack.rb:33:in `compile'
from /app/slug-compiler/lib/slug.rb:464:in `block in run_buildpack'
from /app/slug-compiler/lib/utils.rb:117:in `log'
from /app/slug-compiler/lib/slug.rb:702:in `log'
from /app/slug-compiler/lib/slug.rb:463:in `run_buildpack'
from /app/slug-compiler/lib/slug.rb:107:in `block (2 levels) in compile'
from /app/slug-compiler/lib/utils.rb:98:in `block in timeout'
from /usr/local/lib/ruby/1.9.1/timeout.rb:58:in `timeout'
from /app/slug-compiler/lib/utils.rb:98:in `rescue in timeout'
from /app/slug-compiler/lib/utils.rb:93:in `timeout'
from /app/slug-compiler/lib/slug.rb:96:in `block in compile'
from /app/slug-compiler/lib/utils.rb:117:in `log'
from /app/slug-compiler/lib/slug.rb:702:in `log'
from /app/slug-compiler/lib/slug.rb:95:in `compile'
from /app/slug-compiler/bin/slugc:85:in `block in <main>'
from /app/slug-compiler/lib/slug.rb:472:in `block in lock'
from /app/slug-compiler/lib/repo_lock.rb:44:in `call'
from /app/slug-compiler/lib/repo_lock.rb:44:in `run'
from /app/slug-compiler/lib/slug.rb:472:in `lock'
from /app/slug-compiler/bin/slugc:66:in `<main>'
! Heroku push rejected, failed to compile Ruby/rails app
To git@heroku.application-testing-account:integrating-zxing-on-heroku.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.application-testing-account:integrating-zxing-on-heroku.git'
该问题似乎是由中兴创业板和/或其附属机构ffi、spoon造成的。如果我从Gemfile中删除zxing,Heroku会编译应用程序,一切正常。在重新添加gem时,我遇到了同样的问题。我还尝试在application.rb中将config.assets.initialize_on_precompile设置为true和false,但没有效果。我现在有点不知所措,不知该怎么办
我的应用程序位于Cedar stack上,并在开发和生产中使用PostgreSQL
有人能提供任何建议吗? < P>是的,很不幸,你不能使用C++或java依赖项的任何东西。我很难找到一个纯ruby且工作良好的QR解码器。这看起来像是编译阶段推送过程中的超时,而不是编译错误。我是《中兴》的作者,实际上不知道什么是“宝石”。我不知道这是什么,但如果有问题,这是与其他人的包装,这与代码本身无关。如果我阅读的东西正确,ZXing宝石需要JRuby工作。。。这是正确的吗?如果是这样的话,我相信它对Heroku不会起作用。与其说是回答,不如说是评论!