在 Mac M1 问题上安装 ruby​​ 2.7.3

时间:2021-05-06 18:15:41

标签: macos apple-m1 apple-silicon openproject

当我尝试在它安装的 mac m1 上安装 ruby​​ 2.7.3 版本时,它也显示在我的机器上,但是当我尝试 sudo bin/setup_dev 时,此命令向我显示错误,例如

Bundling rails dependencies Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on
this machine. Your Ruby version is 2.6.3, but your Gemfile specified ~> 2.7.3
bin/setup_dev: 
Failed to run 'bundle install > log/setup_dev.log', check log/setup_dev.log for more information.
aim@aim-MacBook-Air openproject % rbenv global 2.7.3
aim@aim-MacBook-Air openproject % ruby -v                                         
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]

请任何人帮助在 mac 上安装 ruby​​ v 2.7.3。 我尝试的东西

<块引用>

使用 rosetta 2

安装 ruby

我是 ruby​​ 新手,请帮忙解决这个问题。 提前致谢。

1 个答案:

答案 0 :(得分:0)

在 bundler gemfile 中指定 ruby​​ 版本并不会神奇地安装该版本的 ruby​​。您需要从学习使用 ruby​​ 版本管理系统开始。我推荐 Homebrew 和 rbenv。

(不仅仅是为了获得不同的 ruby​​ 版本。始终安装您自己的 ruby​​。切勿将内置系统 ruby​​ 用于任何事情!如果您必须说 sudo,那您就做错了。)