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

牧云@^-^@ 提交于 2019-12-05 14:40:28

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!