0

我在使用 gem install rspec 命令时收到一个错误,我是编程新手,似乎出了什么问题都在我头上。非常感谢任何意见或建议。

Ruby -v ruby​​ 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]

RVM -v rvm 1.21.20(稳定)

问题:无论我输入 gem install rspec, gem -v, which gem, gem list 这里都是消息:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/config_file.rb:221:in load_file read': Is a directory - /Users/JTee/.gemrc (Errno::EISDIR) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/config_file.rb:221:in' 来自 /System/Library/Frameworks/Ruby.framework/Versions/1.8/ usr/lib/ruby/1.8/rubygems/config_file.rb:168:in initialize' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:384:innew' 来自 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:384:inconfiguration' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:634:in路径'来自 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/source_index.rb:68:in installed_spec_directories' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/source_index.rb:58:infrom_installed_gems' 来自 /System/Library/Frameworks/Ruby.framework/Versions /1.8/usr/lib/ruby/1.8/rubygems.rb:881:in source_index' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/gem_path_searcher.rb:81:ininit_gemspecs' 来自 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/gem_path_searcher.rb: 13:在initialize' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:839:in新的'来自/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:839:in searcher' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:838:insynchronize'来自/System/Library/Frameworks/Ruby.framework/Versions/1.8 /usr/lib/ruby/1.8/rubygems.rb:838:in searcher' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:478:infind_files' 来自 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1103 来自 /usr /bin/gem:8:in 'require' 来自 /usr/bin/gem:8

4

1 回答 1

0

尝试删除 /Users/JTee/.gemrc。它应该是一个文件,但在您的计算机上它是一个目录。

于 2013-08-09T15:24:21.437 回答