# Solution to invalid gem format

**URL:** <https://www.ruby-forum.com/t/solution-to-invalid-gem-format/141351>\
**Category:** Rails\
**Created:** [June 24, 2008, 10:32pm UTC](https://www.ruby-forum.com/t/solution-to-invalid-gem-format/141351 "2008-06-24T22:32:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![owen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://www.ruby-forum.com/u/owen)\
**Post date:** [June 24, 2008, 10:32pm UTC](https://www.ruby-forum.com/t/solution-to-invalid-gem-format/141351/1 "2008-06-24T22:32:57Z")

</div>

> **[Rails 2.1: Time zones, dirty, caching, gem dependencies, caching, etc](https://rubyonrails.org/2008/6/1/rails-2-1-time-zones-dirty-caching-gem-dependencies-caching-etc)**
>
> Rails 2.1 is now available for general consumption with all the features and fixes we’ve been putting in over the last six months since 2.0. This has been a huge effort by a very wide range of contributors helping to make it happen.Over the past six...

# hrisff on 24 Jun 06:02:

Anyone else getting this?

$ sudo gem install rails ERROR: Error installing rails: invalid gem  
format for /usr/local/lib/ruby/gems/1.8/cache/activesupport-2.1.0.gem

2.0.2 is installed and working. Using gem v1.2.0 on Leopard

deleting the cached gem and retrying doesn’t help.

# pentor on 24 Jun 14:45:

Same problem here as chrisff also today… could it be a bug in that  
file or in the repository?

# Vincenzo A. on 24 Jun 15:08:

Same problem here, I’ve installed rubygems 1.2.0 and ruby 1.8.7-p22.  
When I try to install rails, I get “invalid gem format for /usr/local/  
lib/ruby/gems/1.8/cache/activesupport-2.1.0.gem”

# JoeTheIntern on 24 Jun 16:12:

Exact problem as chris, pentor and Vince – it was driving me crazy.  
Deleting the cache did not help – the gem magically reappears each  
time.

I managed to install ActiveSupport 2.1.0 by downloading from its  
rubyforge project page manually and installing locally, and then “gem  
install rails” goes through just fine. Looks like a bad repository  
version to me.

Was upgrading from Rails 1.2.3 on Vista, using RubyGems 1.2.

# TomH on 24 Jun 19:21:

I used @JoeTheIntern’s instructions and was able to resolve the  
problem.

[http://rubyforge.org/projects/activesupport/](http://rubyforge.org/projects/activesupport/)

Download gem to a local file, then

sudo gem install—local activesupport-2.1.0.gem

All fixed.

Thanks Joe!

---

<div class="post-metadata">

**Author:** ![owen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/b2d939/32.png) [@owen](https://www.ruby-forum.com/u/owen)\
**Post date:** [August 18, 2008, 7:05pm UTC](https://www.ruby-forum.com/t/solution-to-invalid-gem-format/141351/2 "2008-08-18T19:05:45Z")

</div>

I found that the problem was using [gems.github.com](http://gems.github.com) as one of the  
source repositories.  
once i removed it, and cleaned out the cache directory, things worked  
fine.
