新 mac 直接 gem install rails
提示我 ruby 版本太旧了 2.XX
我就直接 brew 安装了 ruby,貌似成功了
➜ ruby ruby -v
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
再 gem install rails,提示成功了
于是我尝试
➜ ruby rails -v
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
再次安 rails
➜ ruby sudo gem install rails
Password:
Successfully installed rails-7.0.4.3
Parsing documentation for rails-7.0.4.3
Done installing documentation for rails after 0 seconds
1 gem installed
重复 rails -v,一样的
➜ ruby rails -v
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
➜ ruby vi ~/.zshrc
export PATH="/opt/homebrew/lib/ruby/gems/3.2.0/bin:$PATH"
揣测这个 3.2.0 是否代表的是 gems 这个软件版本 不是 ruby
当年不求甚解 只求 caokuaimeng 很多基本概念都没懂 我甚至没用过gem env