Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Invalid gemspec in" and "Illformed requirement" whenever I create a new project in rails (cucumber issue)

Every time I create a new project I get the following errors:

Adams-MacBook-Pro:for_testing adam$ rails new outsidein
Invalid gemspec in [/Users/adam/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/specifications/cucumber-1.0.4.gemspec]: Illformed requirement ["# 0.8.4"]

Invalid gemspec in [/Users/adam/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/specifications/cucumber-1.0.4.gemspec]: Illformed requirement ["# 0.8.4"]
Invalid gemspec in [/Users/adam/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/specifications/cucumber-1.0.4.gemspec]: Illformed requirement ["# 0.8.4"]

I've updated cucumber and cucumber-rails but I get the errors all over the place. What do I do?

like image 329
AdamT Avatar asked Sep 11 '11 15:09

AdamT


2 Answers

You need to update to the latest version of Rubygems, but you may also need to remove any gems installed on the older version of Rubygems.

If you're using rvm with gemsets, this is quite easy:

$ rvm gemset empty

Now you can update Rubygems:

$ gem update --system

If you've lost bundler because it was installed in your gemset, install it in the global gemset so it's there for all your gemsets, for good:

$ rvm @global gem install bundler

Now you can reinstall all your gems in a nice clean gemset on the shiny new Rubygems:

$ bundle

Happy now?

like image 120
mattwynne Avatar answered Nov 08 '22 07:11

mattwynne


This issue is best described on RubyGems blog:

http://blog.rubygems.org/2011/08/31/shaving-the-yaml-yak.html

TL;DR: gem update --system and gem update bundler

RubyGems 1.8.10 solves this.

like image 9
Luis Lavena Avatar answered Nov 08 '22 05:11

Luis Lavena