宝石安装红宝石音频失败 [英] Gem installation ruby-audio failing

查看:114
本文介绍了宝石安装红宝石音频失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我克隆了现有的存储库,现在正在运行 bundle install - 出于某种原因,它在ruby-audio gem上失败。

 使用本机扩展安装ruby-audio(1.6.1)
Gem :: Installer :: ExtensionBuildError:错误:无法构建gem本机扩展。

/Users/thisuser/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
检查/ opt / local / include中的sndfile.h,/ usr / local / include,C:/ Program Files(x86)/ Mega-Nerd / libsndfile / include,C:/ Program Files / Mega-Nerd / libsndfile / include ... no
检查sf_open()in -lsndfile-1 ... no
在-lsndfile中检查sf_open()... no
*** extconf.rb失败***
由于某些原因无法创建Makefile ,可能缺少
必要的图书馆和/或标题。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。

提供的配置选项:
--with-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 = / Users / thisuser / .rvm / rubies / ruby​​-1.9.3-p194 / bin / ruby​​
--with-sndfile-dir
--without-sndfile-dir
--with-sndfile-include
--without-sndfile-include = $ {sndfile-dir} / include
--with-sndfile-lib
--without-sndfile-lib = $ {sndfile-dir} / lib
--with-sndfile-1lib
--without-sndfile-1lib
--with- sndfilelib
--without-sndfilelib
extconf.rb:26:在< main>中:无法找到libsndfile(http://www.mega-nerd.com/libsndfile/)( RuntimeError)

尝试传递--with-sndfile-dir或--with-sndfile-lib和--with-sndfile - 将
选项包含到extconf中。如果窗口中的路径中有空格,则可能无法使用。

Gem文件将保留安装在/Users/thisuser/.bundler/tmp/5253/gems/ruby-audio-1.6.1中进行检查。
结果记录到/Users/thisuser/.bundler/tmp/5253/gems/ruby-audio-1.6.1/ext/rubyaudio_ext/gem_make.out
安装ruby-audio时发生错误(1.6 .1)和Bundler无法继续。
在捆绑之前确保`gem install ruby​​-audio -v'1.6.1'`成功。

老实说,我不知道该怎么做。谷歌搜索显示与MySQL的宝石相同的错误,解决方案是特定于MySQL的。



有没有人偶然发现过这个问题?如果没有,是否有办法明确告诉rails忽略那个gem?将它从gem文件中删除并再次运行 bundle install 并没有成功。



感谢您的帮助!
$ b

编辑

运行 brew安装libsndfile 我得到以下输出:

 警告:您的Xcode(4.5.2)已过时
请安装Xcode 4.6。
==>下载http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.25.tar.gz
已经下载:/Library/Caches/Homebrew/libsndfile-1.0.25.tar.gz
==>修补
修补文件程序/ sndfile-play.c
==> ./configure --prefix = / usr / local / Cellar / libsndfile / 1.0.25
==> make install $ b $ make [1]:*** [sndfile-play.o]错误1
make [1]:***等待未完成的作业....
brew:superenv删除:-g -O2 -Wall -Wextra -Wdeclaration-after-statement -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wcast-align -Wcast-qual -Wnested-externs -Wbad-function-cast -Wwrite-strings -Wundef
brew:删除superenv:-g -O2 -Wall -Wextra -Wdeclaration-after-statement -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wcast-align -Wcast-qual -Wnested-externs - Wbad-function-cast -Wwrite-strings -Wundef
make:*** [install-recursive]错误1
您的Xcode和/或CLT配置错误。尝试以下一些或全部:
xcrun --kill-cache
xcodebuild -license
sudo xcode-select -switch /path/to/Xcode.app

我尝试了所有建议的命令 - 无济于事。我还能做些什么来解决这个问题?

解决方案

所以,我们一起工作,我想我会分享我必须采取措施才能完成这项工作。感谢所有评论过的人!


  1. 问题在于,在安装gem时,找不到 libsndfile

  2. 要安装它,我必须运行 brew install libsndfile 没有工作,所以我不得不... ...

  3. ...将Xcode更新到最新版本并安装Xcodes命令行工具(don' )

  4. 然后我运行 brew install libsndfile ,它可以工作

  5. 最后但并非最不重要的是,我再次运行 bundle install ,最终安装了所需的gem。


I have cloned an existing repository and am now running bundle install - for some reason it fails at the ruby-audio gem.

Installing ruby-audio (1.6.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/Users/thisuser/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
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... no
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:
--with-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=/Users/thisuser/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
--with-sndfile-dir
--without-sndfile-dir
--with-sndfile-include
--without-sndfile-include=${sndfile-dir}/include
--with-sndfile-lib
--without-sndfile-lib=${sndfile-dir}/lib
--with-sndfile-1lib
--without-sndfile-1lib
--with-sndfilelib
--without-sndfilelib
extconf.rb:26:in `<main>':   Can't find libsndfile (http://www.mega-nerd.com/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 /Users/thisuser/.bundler/tmp/5253/gems/ruby-audio-1.6.1 for inspection.
Results logged to /Users/thisuser/.bundler/tmp/5253/gems/ruby-audio-1.6.1/ext/rubyaudio_ext/gem_make.out
An error occured while installing ruby-audio (1.6.1), and Bundler cannot continue.
Make sure that `gem install ruby-audio -v '1.6.1'` succeeds before bundling.

Honestly, I have no idea whatsoever what to do with this. Googling showed the same error with the mysql gem, and the solutions were mysql specific.

Has anyone ever stumbled upon this? If not, is there a way to tell rails explicitly to ignore that gem? Removing it from the gem file and running bundle install again did not do the trick.

Thanks for any help!

Edit

After running brew install libsndfile I got the following output:

Warning: Your Xcode (4.5.2) is outdated
Please install Xcode 4.6.
==> Downloading http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.25.tar.gz
Already downloaded: /Library/Caches/Homebrew/libsndfile-1.0.25.tar.gz
==> Patching
patching file programs/sndfile-play.c
==> ./configure --prefix=/usr/local/Cellar/libsndfile/1.0.25
==> make install
make[1]: *** [sndfile-play.o] Error 1
make[1]: *** Waiting for unfinished jobs....
brew: superenv removed: -g -O2 -Wall -Wextra -Wdeclaration-after-statement -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wcast-align -Wcast-qual -Wnested-externs -Wbad-function-cast -Wwrite-strings -Wundef
brew: superenv removed: -g -O2 -Wall -Wextra -Wdeclaration-after-statement -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wcast-align -Wcast-qual -Wnested-externs -Wbad-function-cast -Wwrite-strings -Wundef
make: *** [install-recursive] Error 1
Your Xcode and or CLT are mis-configured. Try some or all of the following:
    xcrun --kill-cache
    xcodebuild -license
    sudo xcode-select -switch /path/to/Xcode.app

I tried all of the suggested commands - to no avail. What else can I do to solve this?

解决方案

So, we got it working together, and I thought I'd share the steps I had to take to make this work. Thanks to all the guys who commented!

  1. The problem was that while installing the gem, it couldn't find the libsndfile
  2. To install it, I had to run brew install libsndfile (install homebrew first if you don't have it already), which didn't work, so I had to...
  3. ... update Xcode to the latest version and install Xcodes command line tool (don't ask me why, but I had to.)
  4. Then I ran brew install libsndfile, which worked
  5. And last but not least I ran bundle install again, which finally installed the desired gem.

这篇关于宝石安装红宝石音频失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆