簡體   English   中英

Gem 安裝 ruby​​-audio 失敗

[英]Gem installation ruby-audio failing

我已經克隆了一個現有的存儲庫,現在正在運行bundle install - 由於某種原因它在 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.

老實說,我不知道該怎么辦。 谷歌搜索顯示了與 mysql gem 相同的錯誤,解決方案是特定於 mysql 的。

有沒有人偶然發現過這個? 如果沒有,有沒有辦法明確告訴 rails 忽略那個 gem? 從 gem 文件中刪除它並再次運行bundle install並沒有解決問題。

謝謝你的幫助!

編輯

運行brew install libsndfile我得到以下輸出:

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

我嘗試了所有建議的命令 - 無濟於事。 我還能做些什么來解決這個問題?

所以,我們讓它一起工作,我想我會分享我必須采取的步驟來完成這項工作。 感謝所有評論的人!

  1. 問題是在安裝 gem 時,找不到libsndfile
  2. 要安裝它,我必須運行brew install libsndfile (如果您還沒有自制軟件,請先安裝它),但它不起作用,所以我不得不...
  3. ...將 Xcode 更新到最新版本並安裝 Xcodes 命令行工具(不要問我為什么,但我必須這樣做。)
  4. 然后我運行了brew install libsndfile ,它起作用了
  5. 最后但並非最不重要的是,我再次運行了bundle install ,最終安裝了所需的 gem。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM