开发者

Updating rspec gem has caused 'gem' command to become unstable/buggy. Help!

开发者 https://www.devze.com 2023-03-07 09:09 出处:网络
I have installed the latest rspec gem and now every \'gem\' command, no matter what, throws this error:

I have installed the latest rspec gem and now every 'gem' command, no matter what, throws this error:

egervari@egervari:~/Websites/training$ gem -v
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/rspec-core-2.6.2.gemspec]: invalid date format in specification: "2011-05-21 00:00:00.000000000Z"
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:277:in `block in _resort!': undefined method `name' for nil:NilClass (NoMethodError)
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:276:in `sort!'
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:276:in `_resort!'
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:270:in `_all'
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:402:in `each'
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:477:in `map'
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:477:in `find_files'
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1061:in `load_plugins'
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:85:in `<top (required)>'
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/bin/gem:9:in `<main>'

It has completely locked u开发者_运维技巧p my rails development. I can't do anything because of this.

I am on Ubuntu 11.04. I've googled this and it seems I am not the only person who has ran into this. However, I have not come across a solution.

If you don't know how to fix this, how can I manually get rid of all the gems and just start from scratch?

EDIT: It seems that opening up the file and changing it to "2011-05-21" fixes it... but how can this happen? I don't mean to bitch, but I run into weird things with Ruby and Rails all day long. 2 weeks into development and the "problems" I run into just never seem to stop. I'm getting really nervous/worried about my choice to use Rails :(

EDIT 2: My versions

egervari@egervari:~/Websites/training$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
egervari@egervari:~/Websites/training$ gem -v
1.8.1


I had this issue in my Rails app under Ruby 1.9.2p0 (gem version 1.7.2). I manually uninstalled rspec-core 2.6.2 by going into (in my case) /Users/smei/.rvm/gems/ruby-1.9.2-p0 and removing all the rspec-core 2.6.2 stuff. It was not showing up in my list of rspec-core versions when I did gem uninstall.

Then I locked down rspec-core to 2.6.0, and that solved the problem.


What versions of ruby and rubyems are you using?

ruby -v
gem -v

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号