Rails engineer environment construction ruby2.7.1

I will write it as a memorandum because my mac broke down and I had to reinsert it. It also lists non-essential settings such as heroku and item2 settings.

Command Line Tools

xcode-select --install

Is heavy, so install xcode and do it here

スクリーンショット 2020-06-20 10.15.43.png

Verification

 xcode-select -version

Homebrew https://brew.sh/index_ja

Verification

brew -v

rbenv

brew install rbenv ruby-build

zshrc settings

If not

vi .zshrc

Register in .zshrc

/.zshrc


# zsh-completions(Complementary function)settings of
if [ -e /usr/local/share/zsh-completions ]; then
    fpath=(/usr/local/share/zsh-completions $fpath)
fi
autoload -U compinit
compinit -u


# prompt
PROMPT='%m@%n %F{1}%~%f$ '

##################################################
### aliases 
#Git system
alias g='git'
alias gs='git status'
alias gb='git branch'
alias gc= 'git clone'
alias gco='git checkout'
alias gct='git commit'
alias gg='git grep'
alias ga='git add'
alias gd='git diff'
alias gl='git log'
alias gcma='git checkout master'
alias gfu='git fetch upstream'
alias gfo='git fetch origin'
alias gmod='git merge origin/develop'
alias gmud='git merge upstream/develop'
alias gmom='git merge origin/master'
alias gcm='git commit -m'
alias gpo='git push origin'
alias gpom='git push origin master'
alias gst='git stash'
alias gsl='git stash list'
alias gsu='git stash -u'
alias gsp='git stash pop'

export PATH="/usr/local/bin:$PATH"
export PATH="$HOME/.rbenv/shims:$PATH"

export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])"
export CC=/usr/bin/gcc

# Setup Compiler paths for readline and openssl
local READLINE_PATH=$(brew --prefix readline)
local OPENSSL_PATH=$(brew --prefix openssl)
export LDFLAGS="-L$READLINE_PATH/lib -L$OPENSSL_PATH/lib"
export CPPFLAGS="-I$READLINE_PATH/include -I$OPENSSL_PATH/include"
export PKG_CONFIG_PATH="$READLINE_PATH/lib/pkgconfig:$OPENSSL_PATH/lib/pkgconfig"

# Use the OpenSSL from Homebrew instead of ruby-build
# Note: the Homebrew version gets updated, the ruby-build version doesn't
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$OPENSSL_PATH"

# Place [email protected] at the beginning of your PATH (preempt system libs)
export PATH=$OPENSSL_PATH/bin:$PATH

# Load rbenv
eval "$(rbenv init -)"

# Extract the latest version of Ruby so you can do this:
# rbenv install $LATEST_RUBY_VERSION
export LATEST_RUBY_VERSION=$(rbenv install -l | grep -v - | tail -1)


export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"
export PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig

# Ruby 2.Db for 7 and Rails 6:Turn off the warning with create
# export RUBYOPT='-W:no-deprecated -W:no-experimental'

Reflect

source ~/.zshrc

Verification

rbenv

ruby install

Check the installable version

rbenv install -l

install

rbenv install 2.7.1

I saw this when I couldn't (https://github.com/rbenv/ruby-build/issues/1409)

Global settings

rbenv global 2.7.1

Verification

ruby --version

Bundler

** A tool for managing gem dependencies and versions **

gem install bundler

Rails

gem install rails
rbenv rehash

yarn Required for installing webpacker

brew install yarn

I don't know, but it seems to be good to put this in ([Reference](https://qiita.com/Alex_mht_code/items/d2db2eba17830e36a5f1#5%E8%BF%BD%E8%A8%98rbenv-communal-gems%E3%] 81% AF% E5% 85% A5% E3% 82% 8C% E3% 81% A6% E3% 81% 8A% E3% 81% 8D% E3% 81% BE% E3% 81% 97% E3% 82% 87% E3% 81% 86)))

brew install rbenv-communal-gems

webpacker Since webpacker has become a standard specification from Rails6, it is necessary to install yarn.

rails webpacker:install

Ruby 2.7 and Rails 6 with db: create to turn off warnings

/.zshrc


export RUBYOPT='-W:no-deprecated -W:no-experimental'

MySQL

brew install [email protected]

####Verification

mysql --version

#git ssh settings https://qiita.com/shizuma/items/2b2f873a0034839e47ce

#Commands to enter to be happy with git

reference: https://qiita.com/west-hiroaki/items/9560f0504c3bdfe970f5#shell%E3%81%AB%E8%A8%AD%E5%AE%9A%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89

#Heroku settings

brew tap heroku/brew && brew install heroku

Check for the time being https://devcenter.heroku.com/articles/heroku-cli

#iTerm2 settings https://note.com/digiangler777/n/n8206e2163904

#Show hidden files in Finder

defaults write com.apple.finder AppleShowAllFiles TRUE

killall Finder

Open Finder again

Recommended Posts

Rails engineer environment construction ruby2.7.1
Rails environment construction Rails5.2.1 ruby2.5.1 Catalina
Ruby on Rails 6.0 environment construction memo
Rails Docker environment construction
[Docker] Development environment construction Rails6 / Ruby2.7 / MySQL8
Muscle Ruby on Rails Day 1 ~ Environment Construction ~
CentOS8.2 (x86_64) + ruby2.5 + Rails5.2 + MariaDB (10.3.17) environment construction
[Personal memo] Ruby on Rails environment construction (Windows)
Ruby on Rails development environment construction on M1 Mac
Rails6 development environment construction [Mac]
[Docker] Rails 5.2 environment construction with docker
Offline environment construction Ruby edition
[Super easy] Ruby environment construction
[Rails / MySQL] Mac environment construction
[Environment construction] Ruby on Rails 5.2 system development environment construction [within 1 hour]
Deploy to Ruby on Rails Elastic beanstalk (Environment construction)
[Environment construction Mac] Ruby on Rails (+ Webpacker handles errors)
Ruby on Rails environment construction using VirtualBox, Vagrant, cyberduck
Rails + MySQL environment construction with Docker
Ruby environment construction summary ~ mac version ~
Rails on Docker environment construction procedure
[Environment construction with Docker] Rails 6 & MySQL 8
Troublesome Rails environment construction flow [Windows 10]
[Environment construction] Uninstall rails from local
[Rails] AWS EC2 instance environment construction
[Procedure 1 for beginners] Ruby on Rails: Construction of development environment
[Environment construction] Get the Ruby on Rails 6 development environment within 1 hour
Ruby on Rails --From environment construction to simple application development on WSL2
Rails environment construction with Docker (personal apocalypse)
Ruby on Rails development environment construction with Docker + VSCode (Remote Container)
[Java] Environment construction
Rails API server environment construction using docker-compose
Java environment construction
[Spring] Environment construction
Rails & React & Webpacker & MySQL Environment Construction Manual
Docker environment construction
Environment construction of Ruby on Rails from 0 [Cloud9] (From Ruby version change to Rails installation)
[Error] Switch environment construction to use Ruby on Rails oss (open source)
How to solve the local environment construction of Ruby on Rails (MAC)!
How to link Rails6 Vue (from environment construction)
Rails6 [API mode] + MySQL5.7 environment construction with Docker
Road to Java Engineer Part1 Introduction & Environment Construction
[Ruby on Rails] Let's build an environment on mac
Penronse environment construction [Windows]
[Environment construction] Eclipse installation
[Flutter] Ubuntu 20.04 environment construction
Chapter 4 Rails Flavored Ruby
Ruby on Rails Elementary
Ruby on Rails basics
Circle CI environment construction
java development environment construction
Ruby On Rails Association
Ruby, Rails finally installed
Build a Ruby on Rails development environment on AWS Cloud9
virtulbox + vagrant + Docker + nginx + puma + MySQL Rails environment construction
Docker the development environment of Ruby on Rails project
Stable development environment construction manual for "Rails6" with "Docker-compose"
Environment construction of Rails5 + MySQL8.0 + top-level volumes with docker-compose
[Ruby on Rails] From MySQL construction to database change
[Spring Boot] Environment construction (macOS)
Ruby on rails learning record -2020.10.03