How to do if MacOS is Mojave or earlier
Terminal
$ brew install rbenv ruby-build
Terminal
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
Note that bash_profile differs depending on whether the Mac OS version is Catalina or earlier than Mojave.
Terminal
$ source ~/.bash_profile
Terminal
$ brew install readline
realine allows you to input Japanese on the terminal
Terminal
$ brew link readline --force
It takes time to process
Terminal
$ RUBY_CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline)"
$ rbenv install 2.5.1
Terminal
$ rbenv global 2.5.1
Terminal
$ rbenv rehash
Terminal
$ ruby -v
Success if version is displayed
Terminal
$ brew install [email protected]
Set MySQL to start automatically when you start your PC
Terminal
$ mkdir ~/Library/LaunchAgents
$ ln -sfv /usr/local/opt/mysql\@5.6/*.plist ~/Library/LaunchAgents
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql\@5.6.plist
Terminal
#Allows you to execute mysql commands
$ echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
$ source ~/.bash_profile
#Check if you can type mysql command
$ which mysql
#Success if the following is displayed
/usr/local/opt/[email protected]/bin/mysql
Terminal
$ gem install bundler
bundler is for managing gem which is an extension of Rails.
Terminal
$ gem install rails --version='5.2.3'
Terminal
$ rbenv rehash
Terminal
$ rails -v
If the version is displayed, the installation is successful.
Recommended Posts