LoginSignup
1
2

More than 5 years have passed since last update.

OSX(EI Capitan) に rbenv 経由で古い ruby 1.8.7 をインストール

Last updated at Posted at 2016-04-15

古いプロジェクトの開発環境を、インストールする時に嵌ったので備忘録です。

required software

OSX 10.11.3(EI capitan)
XCode 7.3
XCode Command Line Tools
homebrew
rbenv

エラー1

An error occurred while installing libxml-ruby (1.1.4), and Bundler cannot
continue.
Make sure that `gem install libxml-ruby -v '1.1.4'` succeeds before bundling.

エラー2

Could not load OpenSSL.
You must recompile Ruby with OpenSSL support or change the sources in your Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using RVM are available
at rvm.io/packages/openssl.

bundle install などで上記エラーになったので、
以下で必要なものを先にインストールしました。

brew install homebrew/dupes/apple-gcc42
brew install openssl
brew install libxml2
brew install libxslt
brew install libiconv
brew install readline
export CC=`which gcc-4.2`
export CFLAGS='-g -O2'
export RUBY_CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`"
export CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`"
rbenv install 1.8.7-p371

/usr/local/bin/gcc-4.2 は環境によってパスが違うかもしれないので、 which gcc-4.2 で確認してください。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2