Ruby 在从Heroku竹子迁移到Cedar stack的过程中,一些本地图书馆丢失了!如何修复它?

Ruby 在从Heroku竹子迁移到Cedar stack的过程中,一些本地图书馆丢失了!如何修复它?,ruby,ruby-on-rails-3,heroku,shared-libraries,Ruby,Ruby On Rails 3,Heroku,Shared Libraries,我正在将一个生产应用程序从Bambol stack迁移到cedar,我成功地在cedar上推送了该应用程序,但导致了如下错误 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 `b

我正在将一个生产应用程序从Bambol stack迁移到cedar,我成功地在cedar上推送了该应用程序,但导致了如下错误

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

看起来有些本地的LIB在雪松堆上丢失了,而雪松堆存在于竹子堆上。就我而言,是利伯蒂迪


我怎样才能解决这个问题呢?

竹堆和雪松堆在包含的内容上有很大的不同。但是底层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

假设你的应用程序使用了tidy_ffi gem,它要求共享对象文件libtidy.so出现在/usr/lib中

在cedar中,任何像TidyFFI::Tidy.new(“Hello”)这样的调用都会失败

LoadError: Could not open library 'lib.so': lib.so: cannot open shared object file: No such file or directory
要修复它,您可以从Bambol获得libtiy.so的副本(您可以使用scp到任何远程框),并在您的repo中提交它(可能位于RAILS_ROOT/lib/native),然后将以下行添加到environment.rb

ENV['LD_LIBRARY_PATH'] ||="/usr/lib"
ENV['LD_LIBRARY_PATH'] +=":/app/lib/native"
这将使tidy_ffi gem能够查看共享库的lib/native。 将这些更改推送到cedar应用程序,一切都会正常工作

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