2013-01-03 81 views
3

我升級從Rails的3.0.11到3.1.3。當我啓動服務器,它給了錯誤:libffi.so.5:無法打開共享對象文件

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

任何想法如何解決這一問題?

回答

7

也許FFI寶石沒有正確安裝?

gem uninstall ffi 

假設你正在使用Ubuntu:

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

我已經卸載了寶石和重新安裝1.0.11。它工作正常! –

+1

你的意思是'gem uninstall'? [鏈接](http://wiki.vpslink.com/HOWTO:_installing,_updating_and_removing_rubygems) – Casebash

+0

這確實有幫助..我必須做'sudo yum install libffi-devel',因爲我使用的是Amazon AMI。 –

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 - > libffi.so.6.0.1」

希望這有助於(我使用亞馬遜的Linux AMI基於實例。)

+0

正是我需要做的,以解決我的樹莓派2類似的問題。謝謝! – 11101101b

+0

完美!它像一個魅力。謝謝。 –

相關問題