Riod-iOS错误:您没有写权限“ Gem :: FilePermissionError”

时间:2019-07-12 09:17:41

标签: ios ruby rubygems bundler

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

当我运行' $ bundle install '

  

跟踪(最近一次通话最近一次):2:来自/ 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, run捆绑更新--bundler . To install the missing version, run宝石安装捆绑器:2.0.2`

我运行了' $ bundle exec pod pod '

  

跟踪(最近一次通话最近一次):2:来自/ 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, run捆绑更新--bundler . To install the missing version, run宝石安装捆绑器:2.0.2`

因此,我通过运行' $ gem update --system '

  

更新rubygems-update错误:执行gem时...   (Gem :: FilePermissionError)       您对/Library/Ruby/Gems/2.6.0目录没有写权限。

enter image description here

请帮助我。

1 个答案:

答案 0 :(得分:1)

您似乎正在使用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。