1. R_HOMEの設定
.bash_profileに以下を追加。
export R_HOME=/Library/Frameworks/R.framework/Resources
2. RSRubyをインストール
$ gem install rsruby -- --with-R-lib=/Library/Frameworks/R.framework/Libraries --with-R-include=/Library/Frameworks/R.framework/Headers
3. 動くか試す
r_ruby.rb
require 'rsruby'
r = RSRuby::instance
puts r.sum(1,2,3) #=> 6