【问题标题】:Error Pushing to Heroku Caused By ZXing / FFI / Spoon GemZXing / FFI / Spoon Gem 导致向 Heroku 推送错误
【发布时间】:2012-01-05 19:05:32
【问题描述】:

我目前正在从事一个需要 ZXing gem (http://rubydoc.info/gems/zxing/0.3.1/frames) 来解码条形码图像的项目。在我尝试在本地安装 gem 时,我遇到了一些复杂的依赖关系,但通过将 ffi (http://rubygems.org/gems/ffi) 和spoon (http://rubygems.org/gems/spoon) gem 添加到我的 Gemfile 中,这些问题得到了解决,除了jruby-jars。现在,在我的本地机器(iMac 和 MacBook Pro,都运行 Lion)上一切正常。但是,当我尝试将应用程序推送到 Heroku 时,终端会在以下行挂起几分钟:

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

问题似乎是由 ZXing gem 和/或其依赖项(ffi、spoon)引起的。如果我从我的 Gemfile 中删除 zxing,Heroku 会编译应用程序并且一切正常。重新添加 gem 后,我遇到了同样的问题。我还尝试在我的 application.rb 中将 config.assets.initialize_on_precompile 设置为 true 和 false,但无济于事。我有点不知道现在该怎么办。

我的应用程序位于 Cedar 堆栈上,并在开发和生产中使用 PostgreSQL。

谁能给点建议?

【问题讨论】:

  • 这看起来像是在编译阶段推送过程中的超时,而不是编译错误。我是 zxing 的作者,实际上不知道什么是“宝石”。我不知道你在拉什么,但如果有问题,那就是其他人的包装问题,与代码本身无关。
  • 如果我没看错的话,ZXing gem 需要 JRuby 才能工作......这是正确的吗?如果是这样,我不相信它会在 Heroku 上运行。

标签: ruby-on-rails heroku gem zxing ffi


【解决方案1】:

是的,很遗憾,您不能使用任何具有 C++ 或 Java 依赖项的东西。我很难找到纯红宝石(并且运行良好)的 QR 解码器。

【讨论】:

  • 更多的是评论而不是答案!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-11-01
  • 2015-06-18
  • 1970-01-01
  • 2021-09-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多