开发者

How to install ruby-audio on Windows?

开发者 https://www.devze.com 2023-01-29 13:57 出处:网络
I\'m trying to install the ruby-audio gem from warhammerkid onto Windows 7x64 with Ruby 1.9.1 (DevKit installed). Installing libsndfile x64 put files into C:\\Program Files\\Mega-Nerd\\libsndfile (lib

I'm trying to install the ruby-audio gem from warhammerkid onto Windows 7x64 with Ruby 1.9.1 (DevKit installed). Installing libsndfile x64 put files into C:\Program Files\Mega-Nerd\libsndfile (libsndfile-1.dll is in this directory).

When I attempt to install the gem, I get the following (full details below):

C:/Ruby/bin/ruby.exe extconf.rb
checking for sf_open() in -lsndfile... no
....
extconf.rb:8:in `<main>': You need to install libsndfile
(http://www.mega-nerd.com/libsndfile/) (RuntimeError)

You can see the (short) contents of extconf.rb on the GitHub repository. The failing line is:

unless find_library 'sndfile', 'sf_open'

How do I tweak the gem or the libsndfile install to allow the gem to find it? I've tried putting 'C:/Program Files/Mega-Nerd/libsndfile in the paths passed to find_library to no good effect.

Here is the full output of a verbose gem installation:

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

Finally, here is the output in mkmf.log

find_library: checking for sf_open() in -lsndfile... -------------------- no

"gcc -o conftest -IC:/Ruby/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby/include/ruby-1.9.1/ruby/backward -IC:/Ruby/include/ruby-1.9.1 -I.    -I/opt/local/include conftest.c  -L. -LC:/Ruby/lib -L/opt/local/lib -L/usr/local/lib     -lmsvcrt-ruby191-static  -lshell32 -lws2_32  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"gcc -o conftest -IC:/Ruby/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby/include/ruby-1.9.1/ruby/backward -IC:/Ruby/include/ruby-1.9.1 -I.    -I/opt/local/include conftest.c  -L. -LC:/Ruby/lib -L/opt/local/lib -L/usr/local/lib     -lmsvcrt-ruby191-static -lsndfile  -lshell32 -lws2_32 开发者_StackOverflow社区 "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: 
6: /*top*/
7: int main() {return 0;}
8: int t() { void ((*volatile p)()); p = (void ((*)()))sf_open; return 0; }
/* end */

"gcc -o conftest -IC:/Ruby/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby/include/ruby-1.9.1/ruby/backward -IC:/Ruby/include/ruby-1.9.1 -I.    -I/opt/local/include conftest.c  -L. -LC:/Ruby/lib -L/opt/local/lib -L/usr/local/lib     -lmsvcrt-ruby191-static -lsndfile  -lshell32 -lws2_32  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: 
6: /*top*/
7: int main() {return 0;}
8: int t() { sf_open(); return 0; }
/* end */

--------------------
0

精彩评论

暂无评论...
验证码 换一张
取 消