我的Mac系统Ruby安装已完全中断。
我看过几篇推荐我设置RVM或rbenv的文章,但是我试图安装Xcode pod(cocoapods),而且我不知道为什么我的系统Ruby如此损坏。
运行gem
时,得到以下输出:
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /Library/Ruby/Gems/2.3.0/specifications/coffee-script-source-1.11.1.gemspec:16.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /Library/Ruby/Gems/2.3.0/specifications/em-websocket-0.5.1.gemspec:15.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /Library/Ruby/Gems/2.3.0/specifications/escape-0.0.4.gemspec:18.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /Library/Ruby/Gems/2.3.0/specifications/fuzzy_match-2.0.4.gemspec:17.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /Library/Ruby/Gems/2.3.0/specifications/i18n-0.9.5.gemspec:17.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0/specifications/nokogiri-1.5.6.gemspec:22.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /Library/Ruby/Gems/2.3.0/specifications/rouge-2.2.1.gemspec:18.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /Library/Ruby/Gems/2.3.0/specifications/sass-3.7.4.gemspec:21.
RubyGems is a sophisticated package manager for Ruby. This is a
basic help message containing pointers to more information.
看来,这些仅仅是弃用警告,从其他帖子中可以看出,答案只是运行gem pristine --all --no-extensions
。
基本上我运行任何gem
命令时,都会出现权限错误:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0 directory.
如何重置系统Ruby?我不使用Ruby,昨天我运行了命令gem install cocoapods
。从那以后,它就不再可用了。
答案 0 :(得分:0)
请注意,基本上,您应该使用rbenv
之类的工具自行安装Ruby,但是如果您不想这样做,请参考以下答案。
已为root
安装了系统Ruby,因此您需要sudo
命令才能与其进行交互。
尝试sudo gem install cocoapods
。
(顺便说一句,gem
命令,没有子命令,仅显示用法,没有破)