提示:为什么标题限定Mac M1上,因为再加入前团队说是没法正确配置,而我也是第一次做
主要内容
最近由于一些原因换了工作,需要接触Ruby语言及框架,以及Cypress用于前端End-to-End和接口测试。记录以备后面的人用或者遇到相同情况的人参考
1. 系统信息-System Information
uname -a
Darwin EFVCDXLC5 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 arm64
Hardware Overview:
Model Name: MacBook Pro
Model Identifier: MacBookPro18,2
Chip: Apple M1 Max
Total Number of Cores: 10 (8 performance and 2 efficiency)
Memory: 32 GB
System Firmware Version: 7459.121.3
OS Loader Version: 7459.121.3
Hardware UUID: 8220F119-E329-5FAB-84E2-95D9D3DA1111
Provisioning UDID: 00006001-001A51483CEB999E
Activation Lock Status: Disabled
2. 配置后的环境版本-Environments
kielin@EFVCDXLC5 project1 % gem -v
3.1.6
kielin@EFVCDXLC5 project1 % bundle -v
Bundler version 1.17.3
kielin@EFVCDXLC5 project1 % ruby -v
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [arm64-darwin21]
kielin@EFVCDXLC5 project1 % openssl version
OpenSSL 1.1.1q 5 Jul 2022
3. 具体步骤-Detailed Steps
- Install rbenv
# Install rbenv
brew install rbenv
# Initialise rbenv
rbenv init
#then verify rbenv
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor|bash
- Install openssl 1.1
it looks like system built-in openssl not works for installing ruby, maybe its version too higher, so we will install the older version 1.1 with following command.
# Install openssl 1.1
brew install openssl@1.1
# Verify it
openssl version
# check installed path
which openssl
/opt/homebrew/opt/o