簡體   English   中英

從Heroku Bamboo遷移到Cedar堆棧時,缺少一些本地庫!怎么解決?

[英]While migrating from Heroku Bamboo to Cedar stack, some native libraries are missing! How to fix it?

我正在將生產應用程序從竹堆遷移到雪松,我成功地將應用程序推到雪松上,但導致錯誤

LoadError: Could not open library 'lib.so': lib.so: cannot open shared object file: No such file or directory
from /app/vendor/bundle/ruby/1.9.1/gems/ffi-1.0.9/lib/ffi/library.rb:75:in `block in ffi_lib'
from /app/vendor/bundle/ruby/1.9.1/gems/ffi-1.0.9/lib/ffi/library.rb:54:in `map'
from /app/vendor/bundle/ruby/1.9.1/gems/ffi-1.0.9/lib/ffi/library.rb:54:in `ffi_lib'

0.1.3 / lib / tidy_ffi / interface.rb:5:in''

看起來在竹堆上存在的Cedar堆棧上缺少一些原生庫。 就我而言,它的libtidy.so。

我怎樣才能解決這個問題?

Bamboo Stack和Cedar stack在包含它們方面有很大的不同。 但底層的Linux內核和架構是相同的,因此復制文件應該是安全的

(local)$ heroku run bash --app bamboo-app-name
(remote)$ uname -a
  Linux  2.6.32-316-ec2 #31-Ubuntu SMP Wed May 18 14:10:36 UTC 2011 x86_64 GNU/Linux

(local)$ heroku run bash --app cedar-app-name
(remote)$ uname -a
  Linux  2.6.32-316-ec2 #31-Ubuntu SMP Wed May 18 14:10:36 UTC 2011 x86_64 GNU/Linux

讓我們說你的應用程序使用tidy_ffi gem,它需要共享對象文件libtidy.so存在於/ usr / lib中。

在雪松中,任何像TidyFFI :: Tidy.new(“ 你好 ”)這樣的調用都會失敗

LoadError: Could not open library 'lib.so': lib.so: cannot open shared object file: No such file or directory

要修復它,您可以從bamboo獲取libtidy.so的副本(您可以使用scp到任何遠程框)並在您的倉庫中提交它(可能在RAILS_ROOT / lib / native)並將以下行添加到environment.rb

ENV['LD_LIBRARY_PATH'] ||="/usr/lib"
ENV['LD_LIBRARY_PATH'] +=":/app/lib/native"

這將使tidy_ffi gem查看共享庫的lib / native。 將這些更改推送到雪松應用程序,一切都應該正常工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM