Ruby on rails - libffi.so.5:不能打开共享对象文件



我从Rails 3.0.11升级到3.1.3。当我启动服务器时,它给出错误:

>> Using rack adapter
rake aborted!
libffi.so.5: cannot open shared object file: No such file or directory - /home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/ffi-1.0.11/lib/ffi_c.so    
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:240:in `require'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:240:in `block in require'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:223:in `block in load_dependency'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:640:in `new_constants_in'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:223:in `load_dependency'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:240:in `require'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/ffi-1.0.11/lib/ffi.rb:11:in `rescue in <top (required)>'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/ffi-1.0.11/lib/ffi.rb:2:in `<top (required)>'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:240:in `require'   
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:240:in `block in require'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:223:in `block in load_dependency'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:640:in `new_constants_in'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:223:in `load_dependency'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:240:in `require'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/ethon-0.5.3/lib/ethon.rb:2:in `<top (required)>'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:240:in `require'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:240:in `block in require'    
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:223:in `block in load_dependency'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:640:in `new_constants_in'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:223:in `load_dependency'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:240:in `require'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/typhoeus-0.5.3/lib/typhoeus.rb:2:in `<top (required)>'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `block (2 levels) in require'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `block in require'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require'  
/home/srikanth/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.2.1/lib/bundler.rb:128:in `require'  
/home/srikanth/projects/tango/config/application.rb:19:in `<top (required)>'  
/home/srikanth/projects/tango/Rakefile:8:in `require'  
/home/srikanth/projects/tango/Rakefile:8:in `<top (required)>'  
(See full trace by running task with --trace)  

你知道怎么解决这个问题吗?

可能ffi gem没有正确安装?

gem uninstall ffi

假设你使用的是Ubuntu:

sudo apt-get install libffi libffi-dev
gem install ffi -v 1.0.11

因为我已经安装了'ffi'。我必须找到另一个解决方案,试试下面(这对我有帮助):

找到libffi.so文件。5",如果不存在,检查"libffi.so"。(在我的例子中是6,即libffi.so.6)。

现在解除与"/usr/lib64/libffi.so.6"相关联的文件的链接。(在我的例子中,它被指向"libffi.so.6.0.1")

现在为"libffi.so"创建一个新的符号链接。例如"/usr/lib64/libffi.so"。5"应该指向新的"libffi.so.6.0.1"。

即,最终设置应该看起来像:- "/usr/lib64/libffi.so。5 -> libffi.so.6.0.1"

希望这对你有帮助。(我使用基于Amazon Linux AMI的实例)

这对我很有效。

ln -s /usr/lib64/libffi.so.6 /usr/lib64/libffi.so.5

相关内容

  • 没有找到相关文章

最新更新