Skip to content

Latest commit

 

History

History
62 lines (48 loc) · 2.53 KB

2.1.6.md

File metadata and controls

62 lines (48 loc) · 2.53 KB

Ruby 2.1.6

# Install Intel/Rosetta Homebrew
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Temporarily alias Intel Homebrew for conciseness
# You can add this to your shell config to make it more permanent
alias brew_intel="arch -x86_64 /usr/local/bin/brew"

brew_intel install readline
brew_intel install nutcracker/tap/[email protected]
# ...which is a fork of rbenv/tap/[email protected], anticipating a merged pull request: https://github.com/rbenv/homebrew-tap/pull/2

export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew_intel --prefix [email protected]) --with-readline-dir=$(brew_intel --prefix readline)"
export optflags="-Wno-error=implicit-function-declaration"

arch -x86_64 asdf install ruby 2.1.6

# Must install old version of Bundler for Ruby < 2.2
gem install bundler -v '1.17.3'

Note: Some gems may fail to install during bundle install. For some you can follow the prompts to gem install them one-by-one, prefixing them with arch -x86_64.

For MySQL (your specific Gem version may vary):

brew_intel install [email protected]
brew_intel link --force [email protected]
brew_intel services restart [email protected] # Maybe not necessary?
arch -x86_64 gem install mysql2 -v '0.3.21' -- --with-mysql-config=/usr/local/Cellar/[email protected]/5.7.37/bin/mysql_config --srcdir=/usr/local/Cellar/[email protected]/5.7.37/include

For Nokogiri (your specific Gem version may vary):

arch -x86_64 gem install nokogiri -v '1.6.8' --platform=ruby -- --use-system-libraries

For The Ruby Racer (your specific Gem version may vary):

brew_intel install [email protected]
gem install libv8 -v '3.16.14.15' -- --with-system-v8
gem install therubyracer -v '0.12.1' -- --with-v8-dir=/usr/local/opt/[email protected]

Mysql

gem install mysql2 -v '0.3.21' -- --with-mysql-config=/usr/local/bin/mysql_config --with-ldflags=-L/usr/local/Cellar/[email protected]/1.0.2u/lib --with-cppflags=-I/usr/local/Cellar/openssl@1/0/1.0.2u/include

Solution originally pieced together from here:

Verified by:

  • (2022-03-07) Lanny Bose on an M1 (Pro) MacBook Pro on MacOS 12.2.1