Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid gemspec -Illformed requirement ["#<YAML::Syck::DefaultKey:0xb5f9c990> 3.2.0"]

Invalid gemspec in [/usr/lib/ruby/gems/1.8/specifications/activemodel-3.2.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0xb5f9c990> 3.2.0"]

From trying to do a sudo gem update for other issues

getting this hundreds of time as sudo gem update goes through each gem and gets the message for most of them

like image 391
Michael Durrant Avatar asked Jan 25 '12 15:01

Michael Durrant


3 Answers

This can happen when upgrading to Rails 3.2.

Updating Rubygems should fix this issue.

gem update --system

Hope this helps.

like image 95
Phil Bottomley Avatar answered Oct 11 '22 15:10

Phil Bottomley


I still had the errors after updating the rubygem.

Then I ran rvm gemset empty to delete the gems. This fixed it for me.

like image 42
Rainer Blessing Avatar answered Oct 11 '22 15:10

Rainer Blessing


I had this issue, but all the methods above did not help.

So, I decided to move all the *3.2.0.spec within directory

/usr/local/ruby/lib/ruby/gems/1.9.1/specifications

into another directory, and things are solved.

Command:

sudo mv /usr/local/ruby/lib/ruby/gems/1.9.1/specifications/actionmailer-3.2.0.gemspec <another_dir>

Perform similar commands to other files:

  • actionpack-3.2.0.gemspec
  • activemodel-3.2.0.gemspec
  • activerecord-3.2.0.gemspec
  • activeresource-3.2.0.gemspec
  • activesupport-3.2.0.gemspec
  • newrelic_rpm-3.2.0.gemspec
  • rails-3.2.0.gemspec
  • railties-3.2.0.gemspec
like image 27
datnt Avatar answered Oct 11 '22 15:10

datnt