简体   繁体   English

Gem 安装 ruby​​-audio-1.6.1 错误(使用 Mac OS 10.9 / homebrew)

[英]Gem installation ruby-audio-1.6.1 error(using Mac OS 10.9 / homebrew)

I tried other tips but didn't work.我尝试了其他提示,但没有奏效。 (see link below please) (请看下面的链接)
ex.前任。
Gem installation ruby-audio failing Gem 安装 ruby​​-audio 失败
ruby-audio 1.6.1 install error (with installed Libsndfile 1.0.25) ruby-audio 1.6.1 安装错误(安装了 Libsndfile 1.0.25)

I want some feedback on this.我想要一些关于这个的反馈。


$ gem install ruby-audio<br>
Building native extensions.  This could take a while...<br>
ERROR:  Error installing ruby-audio:<br>
    ERROR: Failed to build gem native extension.<br>

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
<br>
**checking for sndfile.h in /opt/local/include,/usr/local/include,C:/Program Files (x86)/Mega-Nerd/libsndfile/include,C:/Program Files/Mega-Nerd/libsndfile/include... yes<br>
checking for sf_open() in -lsndfile-1... no<br>
checking for sf_open() in -lsndfile... no<br>**<br>
*** extconf.rb failed ***<br>
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.<br>
<br>
Provided configuration options:<br>
    --with-opt-dir<br>
    --without-opt-dir<br>
    --with-opt-include<br>
    --without-opt-include=${opt-dir}/include<br>
    --with-opt-lib<br>
    --without-opt-lib=${opt-dir}/lib<br>
    --with-make-prog<br>
    --without-make-prog<br>
    --srcdir=.<br>
    --curdir<br>
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby<br>
    --with-sndfile-dir<br>
    --without-sndfile-dir<br>
    --with-sndfile-include<br>
    --without-sndfile-include=${sndfile-dir}/include<br>
    --with-sndfile-lib<br>
    --without-sndfile-lib=${sndfile-dir}/<br>
    --with-sndfile-1lib<br>
    --without-sndfile-1lib<br>
    --with-sndfilelib<br>
    --without-sndfilelib<br><br>
**extconf.rb:21:in `<main>':   Can't find libsndfile (http://www.mega-nerd.com/libsndfile/) (RuntimeError)**<br>
<br>
  Try passing --with-sndfile-dir or --with-sndfile-lib and --with-sndfile-include<br>
  options to extconf. If there are spaces in the path on windows, it may not work.<br>
<br>
<br>
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ruby-audio-1.6.1 for inspection.<br>
Results logged to /Library/Ruby/Gems/2.0.0/gems/ruby-audio-1.6.1/ext/rubyaudio_ext/gem_make.out

You probably need to install libsndfile as a universal library - by default it doesn't compile a 32-bit slice, which is required for compatibility with the system ruby.您可能需要将 libsndfile 安装为通用库 - 默认情况下它不会编译 32 位切片,这是与系统 ruby​​ 兼容所必需的。

brew uninstall libsndfile
brew install libsndfile --universal
sudo gem install ruby-audio

For ubuntu (Ubuntu 18.04)对于 ubuntu (Ubuntu 18.04)

sudo apt-get update -y须藤 apt-get 更新 -y

sudo apt-get install -y libsndfile-dev sudo apt-get install -y libsndfile-dev

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM