从Heroku Bamboo迁移到雪松堆栈时,某些本地图书馆不见了!如何解决它? [英] While migrating from Heroku Bamboo to Cedar stack, some native libraries are missing! How to fix it?

查看:111
本文介绍了从Heroku Bamboo迁移到雪松堆栈时,某些本地图书馆不见了!如何解决它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一个生产应用程序从竹签迁移到雪松,我成功地将该应用程序推到了雪松上,但导致错误,如

  LoadError:无法打开库'lib.so':lib.so:无法打开共享对象文件:没有这样的文件或目录
来自/app/vendor/bundle/ruby/1.9.1/gems/ffi- 1.0.9 / lib / ffi / library.rb:75:在`block in ffi_lib'
from /app/vendor/bundle/ruby/1.9.1/gems/ffi-1.0.9/lib/ffi/ library.rb:54:`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。



我该如何解决这个问题?

解决方案竹堆和雪松堆栈在它包含的内容方面有很大不同。但是底层的linux内核& architechture是相同的,因此它应该是安全的复制文件

 (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( Hello )的调用都会失败,因为

  LoadError:无法打开库'lib.so':lib.so:无法打开共享对象文件:无此文件或目录

为了修复它,您可以从竹子获得libtidy.so的副本(您可以使用scp到任何远程框)它在你的仓库中(可能在RAILS_ROOT / lib / native),并在environment.rb中添加以下行:
$ b

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

这将使tidy_ffi gem可以查看共享库的lib / native。
将这些更改推送到雪松应用程序,一切都应该正常工作。


I am migrating a production app from bamboo stack to cedar, I successfully pushed the app on cedar but resulting in error like

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

Looks like some native libs are missing on Cedar stack which existed on bamboo stack. In my case, its libtidy.so .

How can I fix this?

解决方案

Bamboo stack and Cedar stack are quite different in terms of whats included in it. But the underlying linux kernel & architechture is same hence it should be safe to copy over the files

(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

Lets say your app uses tidy_ffi gem which requires shared object file libtidy.so to be present in /usr/lib.

In cedar, any call like TidyFFI::Tidy.new("Hello") will fail as

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

To fix it you can obtain a copy of libtidy.so from bamboo (you can use scp to any remote box for that) and commit it in your repo (may be at RAILS_ROOT/lib/native) and add following line to environment.rb

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

This will make tidy_ffi gem to look into lib/native for shared libraries. Push these changes to cedar app and everything should work fine.

这篇关于从Heroku Bamboo迁移到雪松堆栈时,某些本地图书馆不见了!如何解决它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆