Eric Guo's blog.cloud-mes.com

Hoping writing JS, Ruby & Rails and Go article, but fallback to DevOps note

Rails Developer Installation Log on MacBook M1 Pro

Permalink

I got my third MacBook Pro today. It’s the first Apple Silicon CPU Mac. I bought in JD and due to I choose the base model, it’s arrived with in only 10 hours later.

Mac App Store install list

  • AdBlock Pro (10.0.5)
  • Affinity Designer (1.10.4)
  • Affinity Photo (1.10.4)
  • Affinity Publisher (1.10.4)
  • Artstudio Pro (3.2.16)
  • Diagrams (2.2.0)
  • Elmedia Video Player (8.1)
  • iA Writer (5.6.16)
  • iMovie (10.3.1)
  • Instapaper Save (1.2)
  • Jump Desktop (8.8.16)
  • Keynote (11.2)
  • LiquidText (2.1.4)
  • Logoist 4 (4.2.1)
  • Mate Translate (7.1.1)
  • MathStudio (8.1.1)
  • MockFlow (2.4.3)
  • Numbers (11.2)
  • OwlOCR (4.9.2)
  • Pages (11.2)
  • PasteNow (1.10)
  • PDF Expert (2.5.18)
  • Pixelmator Pro (2.3)
  • SimpleMind Pro (1.30.2)
  • Slack (4.22.1)
  • SQLPro Studio (2021.104)
  • Tampermonkey (4.13.6140)
  • Tweetbot (3.5.7)
  • WeChat (3.2.1)
  • Xcode (13.1)
  • 腾讯视频 (2.26.0)

brew install cask list

  • aldente
  • chromedriver
  • chromium
  • dash
  • discord
  • evernote
  • figma
  • google-chrome
  • hype
  • imageoptim
  • marginnote
  • obs
  • paw
  • sublime-merge
  • sublime-text
  • viscosity
  • zoom

brew install console list

  • node
  • ruby
  • bash
  • gh
  • git
  • gdu
  • libxml2
  • memcached
  • percona-server
  • postgresql
  • puma-dev
  • redis
  • yamllint
  • yarn
  • highlight
  • jq
  • unrar
  • imagemagick
  • mas
  • minio
  • smartmontools
  • git-filter-repo
  • git-trim
  • libpq
  • rabbitmq
  • go
  • rust
  • watchman
  • vips
  • lima

Setting ruby .gemrc

~/.gemrc
---
:backtrace: false
:bulk_threshold: 1000
:sources:
- https://rubygems.org/
:update_sources: true
:verbose: true
:concurrent_downloads: 8
gem: "--no-document"

Setting bundler

~/.bundle/config
---
BUNDLE_DEFAULT: "2.1.4"
BUNDLE_BUILD__LIBXML___RUBY: "--with-xml2-include=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2"
BUNDLE_BUILD__NOKOGIRI: "--use-system-libraries --with-xml2-include=/opt/homebrew/Cellar/libxml2/2.9.12/include/libxml2"
BUNDLE_GEM__TEST: "false"
BUNDLE_GEM__CI: "false"
BUNDLE_GEM__MIT: "false"
BUNDLE_GEM__CHANGELOG: "false"
BUNDLE_GEM__RUBOCOP: "false"
BUNDLE_GEMS__CONTRIBSYS__COM: ""
BUNDLE_LOCAL__ACTIVERECORD___ORACLE_ENHANCED___ADAPTER: "/Users/guochunzhong/git/oss/oracle-enhanced"
BUNDLE_LOCAL__ACTIVERECORD___SQLSERVER___ADAPTER: "/Users/guochunzhong/git/oss/activerecord-sqlserver-adapter"
BUNDLE_LOCAL__ADMINISTRATE: "/Users/guochunzhong/git/oss/administrate"
BUNDLE_LOCAL__AJAX___DATATABLES___RAILS: "/Users/guochunzhong/git/oss/ajax-datatables-rails"
BUNDLE_LOCAL__ANNOTATE: "/Users/guochunzhong/git/oss/annotate_models"
BUNDLE_LOCAL__AWESOME_NESTED_SET: "/Users/guochunzhong/git/oss/awesome_nested_set"
BUNDLE_LOCAL__BLADE: "/Users/guochunzhong/git/oss/blade"
BUNDLE_LOCAL__CANONICAL___RAILS: "/Users/guochunzhong/git/oss/canonical-rails"
BUNDLE_LOCAL__CAPISTRANO___RACECAR: "/Users/guochunzhong/git/workstream/capistrano-racecar"
BUNDLE_LOCAL__CAPYBARA___SELECT2: "/Users/guochunzhong/git/oss/capybara-select2"
BUNDLE_LOCAL__CAPYBARA_ACCESSIBLE_SELECTORS: "/Users/guochunzhong/git/oss/capybara_accessible_selectors"
BUNDLE_LOCAL__COFFEE___SCRIPT___SOURCE: "/Users/guochunzhong/git/oss/coffee-script-source"
BUNDLE_LOCAL__DEVISE: "/Users/guochunzhong/git/oss/devise"
BUNDLE_LOCAL__DEVISE___JWT: "/Users/guochunzhong/git/oss/devise-jwt"
BUNDLE_LOCAL__DEVISE_INVITABLE: "/Users/guochunzhong/git/oss/devise_invitable"
BUNDLE_LOCAL__DEVISE_LDAP_AUTHENTICATABLE: "/Users/guochunzhong/git/oss/devise_ldap_authenticatable"
BUNDLE_LOCAL__DOORKEEPER: "/Users/guochunzhong/git/oss/doorkeeper"
BUNDLE_LOCAL__DOORKEEPER___OPENID_CONNECT: "/Users/guochunzhong/git/oss/doorkeeper-openid_connect"
BUNDLE_LOCAL__EXCEPTION_NOTIFICATION: "/Users/guochunzhong/git/oss/exception_notification"
BUNDLE_LOCAL__FRIENDLY_ID: "/Users/guochunzhong/git/oss/friendly_id"
BUNDLE_LOCAL__GLOBALIZE: "/Users/guochunzhong/git/oss/globalize"
BUNDLE_LOCAL__GUARD___LIVERELOAD: "/Users/guochunzhong/git/oss/guard-livereload"
BUNDLE_LOCAL__HOMELAND___JOBS: "/Users/guochunzhong/git/oss/homeland-jobs"
BUNDLE_LOCAL__HOMELAND___NOTE: "/Users/guochunzhong/git/oss/homeland-note"
BUNDLE_LOCAL__HOMELAND___PRESS: "/Users/guochunzhong/git/oss/homeland-press"
BUNDLE_LOCAL__HOMELAND___SITE: "/Users/guochunzhong/git/oss/homeland-site"
BUNDLE_LOCAL__HOMELAND___WIKI: "/Users/guochunzhong/git/oss/homeland-wiki"
BUNDLE_LOCAL__JBUILDER: "/Users/guochunzhong/git/oss/jbuilder"
BUNDLE_LOCAL__JIEBA_RB: "/Users/guochunzhong/git/oss/jieba_rb"
BUNDLE_LOCAL__LISTEN: "/Users/guochunzhong/git/oss/listen"
BUNDLE_LOCAL__MAILGUN___RUBY: "/Users/guochunzhong/git/oss/mailgun-ruby"
BUNDLE_LOCAL__META___TAGS: "/Users/guochunzhong/git/oss/meta-tags"
BUNDLE_LOCAL__MIDORI___CONTRIB: "/Users/guochunzhong/git/oss/midori-confrib"
BUNDLE_LOCAL__MYSQL2: "/Users/guochunzhong/git/oss/mysql2"
BUNDLE_LOCAL__OMNIAUTH: "/Users/guochunzhong/git/oss/omniauth"
BUNDLE_LOCAL__OMNIAUTH___OPENID___CONNECT: "/Users/guochunzhong/git/oss/omniauth_openid_connect"
BUNDLE_LOCAL__OMNIAUTH___OPENID_CONNECT___PROVIDERS: "/Users/guochunzhong/git/oss/omniauth-openid_connect-providers"
BUNDLE_LOCAL__OMNIAUTH___WECHAT___OAUTH2: "/Users/guochunzhong/git/oss/omniauth-wechat-oauth2"
BUNDLE_LOCAL__OMNIAUTH_OPENID_CONNECT: "/Users/guochunzhong/git/oss/omniauth_openid_connect"
BUNDLE_LOCAL__OPENPROJECT___TRANSLATIONS: "/Users/guochunzhong/git/oss/openproject-translations"
BUNDLE_LOCAL__PUNDIT: "/Users/guochunzhong/git/oss/pundit"
BUNDLE_LOCAL__QINIU: "/Users/guochunzhong/git/oss/qiniu-ruby-sdk"
BUNDLE_LOCAL__QUEUE_CLASSIC: "/Users/guochunzhong/git/oss/queue_classic"
BUNDLE_LOCAL__RACK___LIVERELOAD: "/Users/guochunzhong/git/oss/rack-livereload"
BUNDLE_LOCAL__RAILS: "/Users/guochunzhong/git/oss/rails"
BUNDLE_LOCAL__RBTREE: "/Users/guochunzhong/git/oss/rbtree"
BUNDLE_LOCAL__REDIS___NAMESPACE: "/Users/guochunzhong/git/oss/redis-namespace"
BUNDLE_LOCAL__RESPONDERS: "/Users/guochunzhong/git/oss/responders"
BUNDLE_LOCAL__RSPEC___ACTIVEMODEL___MOCKS: "/Users/guochunzhong/git/oss/rspec-activemodel-mocks"
BUNDLE_LOCAL__RSPEC___EXAMPLE_DISABLER: "/Users/guochunzhong/git/oss/rspec-example_disabler"
BUNDLE_LOCAL__RUBY___SAML: "/Users/guochunzhong/git/sso/ruby-saml"
BUNDLE_LOCAL__SAML_IDP: "/Users/guochunzhong/git/sso/saml_idp"
BUNDLE_LOCAL__SDOC: "/Users/guochunzhong/git/oss/sdoc"
BUNDLE_LOCAL__SHOPIFY_APP: "/Users/guochunzhong/git/oss/shopify_app"
BUNDLE_LOCAL__WARDEN___JWT_AUTH: "/Users/guochunzhong/git/oss/warden-jwt_auth"
BUNDLE_LOCAL__WEB___CONSOLE: "/Users/guochunzhong/git/oss/web-console"
BUNDLE_LOCAL__WEBSOCKET___CLIENT___SIMPLE: "/Users/guochunzhong/git/oss/websocket-client-simple"
BUNDLE_LOCAL__WECHAT: "/Users/guochunzhong/git/oss/wechat"
BUNDLE_LOCAL__YXT___API: "/Users/guochunzhong/git/sso/yxt-api"

Copy user fonts and directory

Copy original ~/Library/Fonts and ~/Library/Dictionaries to new mac, which install the fonts and dictionary.

Import GnuPG and setting signing key

brew install gnupg
gnupg
cd ~/.gnupg/
echo 'keyserver hkps://keys.openpgp.org' >> gpg.conf
gpg --search yejun@hey.com
# or download by search at browser https://keys.openpgp.org
gpg --import DCC53DBA60DA2A97EED85CFE0F3E2C6AF4CAAD99.asc
gpg --list-secret-keys user@example.com
gpg --export-secret-keys YOUR_ID_HERE > gpg_ericguocz_private.key
gpg --import gpg_user_private.key
gpg --list-secret-keys --keyid-format=long
git config --global user.signingkey 0D4579F1138D85D3
git config --global commit.gpgsign true

Extend the gpg cache timeout.

~/.gnupg/gpg-agent.conf
default-cache-ttl 34560000
max-cache-ttl 34560000

.profile

export PATH="/opt/homebrew/opt/ruby/bin:$PATH:$HOME/.cargo/bin"
export HISTSIZE=8000
export ADBLOCK=true
export HOMEBREW_GITHUB_API_TOKEN=
export LANG=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
# export RUBYOPT=-w
export EDITOR="vim"
export BUNDLER_EDITOR="subl"
export GEM_EDITOR="subl"
export USE_OFFICIAL_GEM_SOURCE="true"
export HOMEBREW_EDITOR="subl"
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALL_CLEANUP=1
export BASH_IT_HTTP_PROXY=http://127.0.0.1:6152/
export BASH_IT_HTTPS_PROXY=http://127.0.0.1:6152/
export GITHUB_APP_ID=
export GITHUB_APP_SECRET=
export CIRCLE_TOKEN=
# export TNS_ADMIN=/usr/local/network/admin/
# export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export NO_ORACLE_ENHANCED=1
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
export PUPPETEER_EXECUTABLE_PATH=/opt/homebrew/bin/chromium
export MANPATH=/usr/share/man:/opt/homebrew/share/ubuntu_man
export ESBUILD_BINARY_PATH=/opt/homebrew/bin/esbuild
export DEVISE_JWT_SECRET_KEY=
export START_DIR="/Users/guochunzhong/git"
if [[ $PWD == $HOME ]]; then
cd $START_DIR
fi
eval "$(/opt/homebrew/bin/brew shellenv)"

special gem install

gem install tiny_tds -- --with-freetds-dir=$(brew --prefix freetds)
gem install mysql2 -- \
--with-openssl-dir=$(brew --prefix openssl@3) \
--with-ldflags=-L$(brew --prefix zlib)/lib \
--with-mysql-dir=$(brew --prefix mysql-client)

Comments