2012-11-11 104 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? –