2012-12-03 32 views
2

我試圖在我的Mac上安裝RSRuby。打完電話後:未找到在OS X上安裝RSRuby的庫10.7.4

sudo gem install rsruby 

我收到此錯誤:

ERROR: Cannot find the R library, aborting. 
*** 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/xxxxx/.rvm/rubies/ruby-1.9.3-p194/bin/ruby 
    --with-R-dir 
    --with-R-include 
    --without-R-include=${R-dir}/include 
    --with-R-lib 
    --without-R-lib=${R-dir}/lib 
    --with-Rlib 
    --without-Rlib 

我工作在Mac OS X 10.7.4和我通過提供的.pkg安裝R上。

有什麼想法?

+0

而不是追加你的答案爲什麼你不只是提供一個實際的答案? – Dason

+0

@Dason我真的不確定這是行爲習慣,我不知道這是什麼:) –

回答

3

對於相同的情況下任何人都只是做如下:

$ R_HOME=/Library/Frameworks/R.framework/Resources 
$ gem install rsruby -- --with-R-dir=$R_HOME 
+1

如果使用Homebrew安裝R,然後在/ usr/local/Cellar/r中查找相同的Resources文件夾。 。對我來說,它是/usr/local/Cellar/r/3.1.1/R.framework/Resources – Bob

+0

對我來說,它是'/ usr/local/Cellar/r/3.4.1_2/lib/R'。 – Pistos

0

我運行OS X 10.9.4,這爲我工作。

export R_HOME=/Library/Frameworks/R.framework/Resources 
gem install rsruby -- --with-R-dir=$R_HOME --with-R-include=$R_HOME/include --with-R-lib=$R_HOME/lib 
0

我遇到了這個問題,因爲我還沒有在我的Mac(Yosemite)上安裝R。我是這樣使用的

$ brew tap homebrew/science 
$ brew install gcc 
$ brew install Caskroom/cask/xquartz 
$ brew install r