warhammerkid / ruby-audio

ruby-audio wraps around libsndfile to provide simplified sound reading and writing support to ruby programs
http://doc.chromedshark.com/ruby-audio/
GNU General Public License v2.0
108 stars 27 forks source link

Can't install on Windows #1

Closed Phrogz closed 13 years ago

Phrogz commented 13 years ago

Win7x64; Ruby 1.9.1; RubyGems v1.3.7 Installed http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.23-w64-setup.exe Tried to install ruby-audio, failed:

C:\>gem install ruby-audio --verbose
GET http://rubygems.org/latest_specs.4.8.gz
302 Found
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
Installing gem ruby-audio-1.3.0
Downloading gem ruby-audio-1.3.0.gem
GET http://rubygems.org/gems/ruby-audio-1.3.0.gem
connection reset after 2 requests, retrying
GET http://rubygems.org/gems/ruby-audio-1.3.0.gem
302 Found
GET http://production.cf.rubygems.org/gems/ruby-audio-1.3.0.gem
200 OK
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/README.rdoc
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/Rakefile
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/LICENSE
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/lib/ruby-audio/buffer.rb
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/lib/ruby-audio/sound.rb
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/lib/ruby-audio/sound_info.rb
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/lib/ruby-audio.rb
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/spec/buffer_spec.rb
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/spec/sound_info_spec.rb
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/spec/sound_spec.rb
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/spec/spec_helper.rb
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/spec/spec.opts
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/spec/data/what.wav
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/spec/data/what2.wav
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/spec/data/what.mp3
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/ext/extconf.rb
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/ext/ra_buffer.c
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/ext/ra_sound.c
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/ext/ra_soundinfo.c
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/ext/rubyaudio_ext.c
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/ext/ra_buffer.h
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/ext/ra_sound.h
C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/ext/ra_soundinfo.h
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-audio:
        ERROR: Failed to build gem native extension.

C:/Ruby/bin/ruby.exe extconf.rb
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:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby/bin/ruby
        --with-sndfilelib
        --without-sndfilelib
extconf.rb:8:in `<main>': You need to install libsndfile (http://www.mega-nerd.com/libsndfile/) (RuntimeError)

Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0 for inspection.
Results logged to C:/Ruby/lib/ruby/gems/1.9.1/gems/ruby-audio-1.3.0/ext/gem_make.out
Phrogz commented 13 years ago

Using manual ruby extconf.rb --with-sndfilelib=libsndfile-1 got me a hair closer, after copying the lib and header files all over creation. In the end I got a make file that build all the .o files, but failed at the linker stage.

warhammerkid commented 13 years ago

I just put up a new version of ruby-audio, version 1.4.0, that should work perfectly. Make sure you install libsndfile 32-bit, or compile ruby from scratch so that it's 64-bit. Make sure that you add the install path for libsndfile to your PATH variable, or you will get "missing libsndfile-1.dll" errors when you require 'ruby-audio'. On 32-bit XP I can just run gem install ruby-audio and it installs perfectly, but you may need to use gem install ruby-audio -- --with-sndfile-lib="C:/LIB_SNDFILE_INSTALL_DIR" --with-sndfile-include="C:/LIB_SNDFILE_INSTALL_DIR/include".