Install Ruby on Rails with Jemalloc on Mac Mojave

Install Ruby on Rails with Jemalloc on Mac Mojave

First we need to Install Ruby via Homebrew :

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

And then install dependency libraries :

brew install rbenv gmp jemalloc ruby-build sqlite3

Add rbenv to bash profile :

echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile

Install Ruby :

RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 2.6.4

rbenv global 2.6.4

Install Rails Gem :

gem install bundler; gem install rails; rbenv rehash

Use SQLite3 Homebrew’s package instead of macos builtin :

bundle config build.sqlite3 --with-sqlite3-include=/usr/local/opt/sqlite/include --with-sqlite3-lib=/usr/local/opt/sqlite/lib

Finally Generate Rails App :

rails new myapp
Scroll to Top
%d bloggers like this: