Homebrew install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Libraries
brew install rbenv ruby-build sqlite3 jemalloc gmp
Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
Install Ruby and Rails
RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 2.5.3
rbenv global 2.5.3
gem install bundler
gem install rails
rbenv rehash
Generate Rails Project
rails new blog --skip-bundle
cd blog
Use homebrew sqlite3 instead of macos builtin. Replace 3.26.0
with installed version
gem install sqlite3 -- --with-sqlite3-include=/usr/local/Cellar/sqlite/3.26.0_1/include --with-sqlite3-lib=/usr/local/Cellar/sqlite/3.26.0_1/lib
Or better
bundle config build.sqlite3 --with-sqlite3-include=/usr/local/opt/sqlite/include --with-sqlite3-lib=/usr/local/opt/sqlite/lib
Finally
bundle