This is a remarks of the procedure performed when building the development environment for Rails 6 using Mac.
** A system that manages software installation and uninstallation ** https://brew.sh/index_ja Copy the command at the bottom of Install Homebrew and run it in the terminal
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
You will be asked for a password, so enter the password when you start your Mac
Next, enter the following command and execute it to pass the Homebrew path.
$ echo ‘export PATH=/usr/local/bin:$PATH’ >> .bash_profile source .bash_profile
Finally, execute the following command for confirmation
$ brew -v
Homebrew ○.○.○
If the version is displayed like
** Tool to switch Ruby version control ** Install using Homebrew
#Initial setting
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
#Reflect the initial settings
$ source ~/.bash_profile
#Install rbenv
$ brew install rbenv ruby-build
#Ruby version list display
$ rbenv install -l
2.5.8
2.6.6
2.7.1
...
#Install the specified Ruby version
$ rbenv install 2.7.1
#Run and make it available when you install a new Ruby or gem
$ rbenv rehash
Ruby version to use
$ rbenv global 2.7.1
** A tool for managing gem dependencies and versions **
$ gem install bundler
$ gem install rails
Required for installing webpacker
brew install yarn
Since webpacker has become a standard specification from Rails6, it is necessary to install yarn.
$ rails webpacker:install
#Create a Rails project
$ rails new sample
#Go to Rails project
$ cd sample
#Launch a Rails project
$ rails server
http://localhost:3000/ Complete if the Rails page can be displayed
Recommended Posts