libffi.so.5:无法打开共享对象文件

时间:2013-01-03 12:07:44

标签: ruby-on-rails ruby-on-rails-3

我从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)  

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

3 个答案:

答案 0 :(得分:7)

也许ffi gem没有正确安装?

gem uninstall ffi

假设您使用的是Ubuntu:

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

答案 1 :(得分:3)

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

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

现在取消链接与“/usr/lib64/libffi.so.6”关联的文件。 (就我而言,它被指向“libffi.so.6.0.1”)

现在为“libffi.so.5”创建一个新的符号链接,这样“/usr/lib64/libffi.so.5”应指向新的符号链接“libffi.so.6.0.1”。

即,最终设置应如下所示: - “/usr/lib64/libffi.so.5 - &gt; libffi.so.6.0.1”

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

答案 2 :(得分:0)

这对我有用。

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