我在使用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,哪个gem,gem list在这里是消息:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/config_file.rb:221:in 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
load_file'
来自/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:in
new'
来自/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:384:in configuration'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:634:in
path'
来自/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:in
from_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:in
init_gemspecs'
来自/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/gem_path_searcher.rb:13:in initialize'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:839:in
new'
来自/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:in
synchronize'
来自/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:in
find_files'
来自/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1103
来自/ usr / bin / gem:8:在'require'中
来自/ usr / bin / gem:8
答案 0 :(得分:0)
尝试删除/Users/JTee/.gemrc。它应该是一个文件,但在您的计算机上它是一个目录。