gpt4 book ai didi

ruby - 我的 ruby 有问题

转载 作者:数据小太阳 更新时间:2023-10-29 07:07:45 25 4
gpt4 key购买 nike

总是同样的错误:


AilixdeMacBook-Pro:~ Ailix$ ruby -v
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
AilixdeMacBook-Pro:~ Ailix$ ruby -d
Exception `LoadError' at /Library/Ruby/Site/2.0.0/rubygems.rb:1240 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /Library/Ruby/Site/2.0.0/rubygems.rb:1249 - cannot load such file -- rubygems/defaults/ruby
Exception `NameError' at /Library/Ruby/Site/2.0.0/rubygems.rb:1257 - uninitialized constant Gem::Specification
/Library/Ruby/Site/2.0.0/rubygems.rb:1257:in `': uninitialized constant Gem::Specification (NameError)
from :1:in `require'
from :1:in `'
AilixdeMacBook-Pro:~ Ailix$ gem -v
/Library/Ruby/Site/2.0.0/rubygems.rb:1257:in `': uninitialized constant Gem::Specification (NameError)
from :1:in `require'
from :1:in `'
AilixdeMacBook-Pro:~ Ailix$ brew -v
/Library/Ruby/Site/2.0.0/rubygems.rb:1257:in `': uninitialized constant Gem::Specification (NameError)
from :1:in `require'
from :1:in `'
AilixdeMacBook-Pro:~ Ailix$ pod repo
/Library/Ruby/Site/2.0.0/rubygems.rb:1257:in `': uninitialized constant Gem::Specification (NameError)
from :1:in `require'
from :1:in `'

我猜我的 ruby 有问题。但是我不知道怎么解决

我的环境:

MacOS 10.10.5Xcode 7.2

提前致谢

最佳答案

系统 ruby​​ 安装似乎搞砸了。尝试删除有问题的 /Library/Ruby/Site/2.0.0/rubygems.rb(并且可能是更多的封闭文件夹)

Ruby 在 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0 中有其捆绑的 ruby​​gems,因此它应该与这些一起工作。

一旦 ruby​​ 可用 - 如果需要,您可以尝试通过 sudo gem update --system 再次升级 ruby​​gems,但我建议设置一个 ruby​​ 版本管理器,如 rvm ( rvm.io) 并让系统 ruby​​ 仅在紧急情况下存在并支持 brew

关于ruby - 我的 ruby 有问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35240324/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com