v_a*_*i_v 4 ruby heroku shared-libraries ruby-on-rails-3
我正在将生产应用程序从竹堆迁移到雪松,我成功地将应用程序推到雪松上,但导致错误
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'
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
(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
Run Code Online (Sandbox Code Playgroud)
让我们说你的应用程序使用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
Run Code Online (Sandbox Code Playgroud)
要修复它,您可以从bamboo获取libtidy.so的副本(您可以使用scp到任何远程框)并在您的仓库中提交它(可能在RAILS_ROOT/lib/native)并将以下行添加到environment.rb
ENV['LD_LIBRARY_PATH'] ||="/usr/lib"
ENV['LD_LIBRARY_PATH'] +=":/app/lib/native"
Run Code Online (Sandbox Code Playgroud)
这将使tidy_ffi gem查看共享库的lib/native.将这些更改推送到雪松应用程序,一切都应该正常工作.
| 归档时间: |
|
| 查看次数: |
958 次 |
| 最近记录: |