1.安装xcode
2.从oracle官网下载以下安装包
instantclient-basic-macos.x64-12.1.0.2.0.zip
instantclient-sdk-macos.x64-12.1.0.2.0.zip
下载地址:http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html
3.将下载的安装包复制到$HOME/Library/Caches/Homebrew目录下
执行以下安装命令
brew tap InstantClientTap/instantclient brew install instantclient-basic brew install instantclient-sdk
4.设置环境变量
export OCI_DIR=$(brew --prefix)/lib
5.安装ruby-oci8
gem install ruby-oci8
参考地址:http://www.rubydoc.info/gems/ruby-oci8/file/docs/install-on-osx.md
linux系统 参考地址:http://www.rubydoc.info/gems/ruby-oci8/file/docs/install-instant-client.md