2012-11-11 43 views
0

我的Rails应用程序通过本地主机工作得很好我的机器上,但是当我部署它的Heroku我的错误此列表:配置在Heroku的环境路径

2012-11-11T04:59:20+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e production -p 38941` 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/ffi-inline-0.0.4/lib/ffi/inline/builders/c.rb:114:in `shared_object' 
2012-11-11T04:59:33+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/ffi-inline-0.0.4/lib/ffi/inline/compilers/gcc.rb:29:in `compile': compile error: see logs at /tmp/.ffi-inline-18803/85aad7364f11885370e58c4391df70e29ef22bbe.log (CompilationError) 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/ffi-inline-0.0.4/lib/ffi/inline/builders.rb:87:in `instance_eval' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/ffi-inline-0.0.4/lib/ffi/inline/builders.rb:87:in `build' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/ffi-inline-0.0.4/lib/ffi/inline/inline.rb:39:in `inline' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/ffi-inline-0.0.4/lib/ffi/inline/inline.rb:54:in `singleton_inline' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/tesseract-ocr-0.1.5/lib/tesseract/c.rb:34:in `<module:C>' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/tesseract-ocr-0.1.5/lib/tesseract/c.rb:31:in `<module:Tesseract>' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/tesseract-ocr-0.1.5/lib/tesseract/c.rb:29:in `<top (required)>' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/tesseract-ocr-0.1.5/lib/tesseract/api.rb:26:in `<top (required)>' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/ffi-inline-0.0.4/lib/ffi/inline/builders.rb:90:in `block in build' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/tesseract-ocr-0.1.5/lib/tesseract-ocr.rb:35:in `<top (required)>' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `block (2 levels) in require' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require' 
2012-11-11T04:59:33+ 
00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.1/lib/bundler.rb:128:in `require' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/config/application.rb:7:in `<top (required)>' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/config/environment.rb:2:in `require' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `block in require' 
2012-11-11T04:59:33+00:00 app[web.1]: from config.ru:3:in `require' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/config/environment.rb:2:in `<top (required)>' 
2012-11-11T04:59:33+00:00 app[web.1]: from config.ru:3:in `block in <main>' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/controllers/controller.rb:181:in `load_rackup_config' 
2012-11-11T04:59:33+00:00 app[web.1]: from config.ru:1:in `new' 
2012-11-11T04:59:33+00:00 app[web.1]: from config.ru:1:in `<main>' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/bin/thin:6:in `<top (required)>' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/thin:19:in `load' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/thin:19:in `<main>' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/rack/adapter/loader.rb:33:in `eval' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/rack/adapter/loader.rb:33:in `load' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/controllers/controller.rb:71:in `start' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:185:in `run_command' 
2012-11-11T04:59:33+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.4.1/lib/thin/runner.rb:151:in `run!' 
2012-11-11T04:59:34+00:00 heroku[web.1]: Process exited with status 1 
2012-11-11T04:59:38+00:00 heroku[router]: Error H10 (App crashed) 

我似乎无法使头或除此之外,Heroku可能与我正在使用的Ruby Tesseract gem有一些问题。也许是一个依赖的问题?

UPDATE:

经过进一步搜索,事实证明,the issue is related to the Tesseract gem

按照支持票,我需要设置这些路径...

ENV['CFLAGS'] = '-I/path/to/the/headers' 
ENV['LDFLAGS'] = '-L/path/to/the/libs' 

...但我不知道如何设置他们或什么路径头/库实际上应该是在部署到Heroku的Rails应用程序上。任何见解?

+0

请显示您的日志文件,查看日志,在您的命令行输入'heroku logs'。 – Thanh

+0

我上面粘贴的代码是'heroku logs'的输出。 – Michael

+0

好吧,我在Tesseract-OCR gem github上发现了一个关于相同问题的封闭票:https:// github。com/meh/ruby​​-tesseract-ocr/issues/3不过,在Heroku的上下文中不确定如何或在哪里设置这些'ENV ['CFLAGS']值。 – Michael

回答

3

下面是从Heroku的到票我跟他们提出了对此的答复:


你好,

不幸的是,我们不支持安装额外的库或二进制文件到我们的堆栈。最好的解决方法是将这些供应商提供给您的项目。您需要使用64位Linux版本才能在Heroku上运行;静态编译还可以帮助确保包含所需的任何依赖项。同样,对于依赖外部图书馆的宝石,我们建议静态编译宝石并将宝石销售到您的项目中。

我们认识到这不是一件简单的工作,而且可能非常难以工作,我们希望在将来提供一种更简单的方法来做到这一点。不幸的是,当这种改进的功能可用时,我们没有ETA。

如果您确实希望尝试供应您的二进制,库或gem,那么您可以使用Heroku作为构建环境。我们的一位工程师创建了一个构建服务器,允许您上传源代码,运行编译步骤,然后下载生成的二进制文件。你可以找到这个项目在这里: https://github.com/heroku/vulcan

感谢, Heroku的支持


换句话说,去部署别的地方。

+0

它花了Heroku 8顺便说一下,我将这个回复发送给我的机票,这是我第三次必须等待一周或更长时间才能获得与他们的支持票的答案。 – Michael

1

我也面临同样的问题,所以希望我们可以互相帮助。

我找到了a way to set config var on Heroku。根据meh对github的评论,看起来它需要在Heroku上安装Tesseract。也许你可以问Heroku安装位置在哪里?

我也发现这个other gem提到要成功整合到Heroku。不幸的是,它仍然在使用tesseract 2.04。

+0

谢谢!我仍在挖掘这一点,并与Heroku公开支持票。然而,街上的文字是这可能是一个注定要失败的努力 - Heroku对C库的支持不应该是非常强大的。不过,我会在这里发布任何有用的更新。 – Michael

+0

我试过其他tesseract宝石,似乎没有工作。 :( – numnym

+0

@Michael你有没有设法在Heroku上运行tesseract? –