1
votes

When I upgraded my ruby gems, the following error appeared. It seems like this is related to some bug, but I I am not sure about the detail. How can I fix it?

$ sudo gem update --system
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/looksee-1.0.3.gemspec]: Illformed requirement ["# 0.3.0"]
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/looksee-1.0.3.gemspec]: Illformed requirement ["# 0.3.0"]
Latest version currently installed. Aborting.

I uninstalled looksee-1.0.2, and I further tried to uninstall looksee, but I cannot:

$ sudo gem uninstall looksee
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/looksee-1.0.3.gemspec]: Illformed requirement ["# 0.3.0"]
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/looksee-1.0.3.gemspec]: Illformed requirement ["# 0.3.0"]
INFO: gem "looksee" is not installed

1

1 Answers

1
votes

I'm not sure why this is happening, but I can give you some tips on how to solve this.

  1. Updating rubygems can break stuff. Recently I did gem update --system after about 6 months of not doing any Ruby and everything stopped working.
  2. Ruby 1.9.1 is not really good, 1.9.2 is way less buggy
  3. I recommend you take a look at RVM or rbenv, which will make these things easy

With RVM, you can easily do something like

rvm install 1.9.2
rvm use 1.9.2 --default
rvm gemset empty
gem install bundler
cd your/project
bundle install

if things stop working, you can just do

rvm implode
rm -rf ~/.rvm

and then start again, which is way faster than trying to fix bug after big updates.

I know this isn't the advice you were looking for, but it solves most gem related problems