Search code examples
ruby-on-railsamazon-web-servicesamazon-elastic-beanstalk

libsndfile.so.1: cannot open shared object file: No such file or directory


libsndfile.so.1: cannot open shared object file: No such file or directory - /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/ruby-audio-1.6.1/rubyaudio_ext.so (LoadError)
  /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/ruby-audio-1.6.1/lib/ruby-audio.rb:6:in `require'
  /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/ruby-audio-1.6.1/lib/ruby-audio.rb:6:in `rescue in <top (required)>'
  /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/ruby-audio-1.6.1/lib/ruby-audio.rb:1:in `<top (required)>'
  /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/json-waveform-0.2.1/lib/json-waveform.rb:3:in `require'
  /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/json-waveform-0.2.1/lib/json-waveform.rb:3:in `<top (required)>'
  /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
  /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
  /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
  /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
  /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
  /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
  /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
  /var/app/current/config/application.rb:7:in `<top (required)>'
  /var/app/current/config/environment.rb:2:in `require'
  /var/app/current/config/environment.rb:2:in `<top (required)>'
  config.ru:3:in `require'
  config.ru:3:in `block in <main>

But when i check as

"ll  /opt/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/ruby-audio-1.6.1/"

File is present there in redhat aws server.

How can I fix this issue ? Thanks


Solution

  • ldconfig -p | grep libsndfile.so
    

    If this doesn't find the file then find where your libsndfile-1.0.27 is.

    Add the directory of the path to libsndfile-1.0.27 to a file in /etc/ld.so.conf.d.

    After adding the file to /etc/ld.conf.d run ldconfig