所以我想安裝audite gem,但rbenv有問題:rbenv和需要C擴展寶石
$ bundle install
Fetching gem metadata from https://rubygems.org/...
Installing audite (0.3.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/opt/boxen/rbenv/versions/1.9.3-p448/bin/ruby extconf.rb
checking for mpg123.h... 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=/opt/boxen/rbenv/versions/1.9.3-p448/bin/ruby
please install mpg123 headers
Gem files will remain installed in /opt/boxen/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/audite-0.3.0 for inspection.
Results logged to /opt/boxen/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/audite-0.3.0/ext/mpg123/gem_make. out
An error occurred while installing audite (0.3.0), and Bundler cannot continue.
Make sure that `gem install audite -v '0.3.0'` succeeds before bundling.
我知道這些寶石需要C擴展,我已經用他們自制安裝。如果我進入地窖自制軟件,我可以看到它在尋找(mpg123.h
)
/opt/boxen/homebrew/Cellar/mpg123/1.15.4/include/mpg123.h
所以文件,有沒有辦法添加到rbenv環境中,這不只是SIM聯或直接複製成/opt/boxen/rbenv/versions/1.9.3-p448/
很抱歉,您意思是在我的路徑中添加'/ opt/boxen/homebrew/Cellar/mpg123/1.15.4/include /'?那麼我不需要爲每個擴展需要做這件事,因爲我也有類似的問題portaudio ... –
在默認的自制軟件安裝(到'/ usr/local')它會創建一個'/ usr/local/include'文件夾。這也應該存在於'/ opt/boxen/homebrew/include'中。該文件夾包含指向包的各個'include'目錄的符號鏈接。 – Femaref
我給它一個嘗試,但沒有骰子,我的輸出作爲一個要點:https://gist.github.com/petems/6812615 –