ruby-audio-heroku gem not working

Thursday, July 10, 2014

I am working on an heroku app (Ruby 1.9.3 and Rails 3.2.12). I want to use the ruby-audio gem. I first added the gem in my Gemfile and pushed to Heroku, but it needs libsndfile to work and I can't add it to heroku.

I tried the ruby-audio-heroku gem and I pushed to Heroku. Unfortunately, Heroku gives me the following error message :

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/tmp/build_36c98c76-48a8-4a9a-893b-964c6d7fe4ec/vendor/ruby-2.0.0/bin/ruby extconf.rb
checking for sndfile.h in vendor/libsndfile/include,/opt/local/include,/usr/local/include,C:/Program Files (x86)/Mega-Nerd/libsndfile/include,C:/Program Files/Mega-Nerd/libsndfile/include... yes
checking for sf_open() in -lsndfile-1... no
checking for sf_open() in -lsndfile... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
extconf.rb:21:in `<main>': Can't find libsndfile ( (RuntimeError)

Try passing --with-sndfile-dir or --with-sndfile-lib and --with-sndfile-include
options to extconf. If there are spaces in the path on windows, it may not work.

Gem files will remain installed in /tmp/build_36c98c76-48a8-4a9a-893b-964c6d7fe4ec/vendor/bundle/ruby/2.0.0/gems/ruby-audio-heroku-1.6.2 for inspection.
Results logged to /tmp/build_36c98c76-48a8-4a9a-893b-964c6d7fe4ec/vendor/bundle/ruby/2.0.0/gems/ruby-audio-heroku-1.6.2/ext/rubyaudio_ext/gem_make.out
Installing rack-test 0.6.2
Installing pg 0.17.1
An error occurred while installing ruby-audio-heroku (1.6.2), and Bundler cannot
Make sure that `gem install ruby-audio-heroku -v '1.6.2'` succeeds before
! Failed to install gems via Bundler.

! Push rejected, failed to compile Ruby app

I don't really know what to do. I thought that ruby-audio-heroku would fix the problem I had with libsndfile. Can someone help me understand ?