Riod-iOS Error: You don't have write permissions "Gem::FilePermissionError"

Riod-iOS Error: You don't have write permissions "Gem::FilePermissionError"

我已经下载 Riot-iOS 并按照构建说明进行操作。

当我 运行 '$ bundle install'

Traceback (most recent call last): 2: from /usr/bin/bundle:23:in <main>' 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in activate_bin_path' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in find_spec_for_exe': Could not find 'bundler' (2.0.2) required by your /Users/premkumar/Downloads/riot-ios-develop/Gemfile.lock. (Gem::GemNotFoundException) To update to the latest version installed on your system, runbundle update --bundler. To install the missing version, rungem install bundler:2.0.2`

在我运行一个'$ bundle exec pod install'

之后

Traceback (most recent call last): 2: from /usr/bin/bundle:23:in <main>' 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in activate_bin_path' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in find_spec_for_exe': Could not find 'bundler' (2.0.2) required by your /Users/premkumar/Downloads/riot-ios-develop/Gemfile.lock. (Gem::GemNotFoundException) To update to the latest version installed on your system, runbundle update --bundler. To install the missing version, rungem install bundler:2.0.2`

所以,我通过 运行ning '$gem update --system'

更新了一个 gem

Updating rubygems-update ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

请帮助我。

看起来您正在使用 MacOS 附带的系统 Ruby。为了使其工作,您需要使用 sudo 尝试 运行 这些命令。您也可以尝试使用 RVM(https://rvm.io/) 安装 Ruby 然后 运行 没有 sudo

的相同命令

RVM 让它变得非常简单。 运行 来自您的终端:

\curl -sSL https://get.rvm.io | bash -s stable --ruby

此命令将安装 RVM 和最新的 Ruby 稳定版本 2.6.3。