Installation Problem: Invalid Gem format

Hey I am having a problem installing rails on my ubuntu machine. I
cannot install any gems and keep on getting the following error.

ERROR: Error installing rails:
        invalid gem format for /usr/lib/ruby/gems/1.8/cache/

I have tried updating rubygems, manually installing rubygems (not
using synaptic) and still cannot get ruby gems to work.

It would be great if anybody could give me a hand.


I had the same problem and deleted the file
activerecord-2.0.2.gem resolved the problem for me. Hope is helps

dizz wrote:

i try deleted file and after execute command the file is recreate :frowning:

Hello Folks:

I had the same problem, but with actionpack-2.1.0.gem. The way I solved
it was by deleting actionpack, and then updating gems:

cd /usr/lib/ruby/gems/1.8/cache/
rm actionpack-2.1.0.gem

cd /usr/local/rubygems-0.9.5/
gem update –system
gem install rails --include-dependencies


I've just made:

sudo apt-get remove ruby1.8
sudo apt-get remove ruby1.8-dev
sudo apt-get remove rubygems1.8
sudo apt-get install ruby1.9.2
sudo apt-get install ruby1.9.2-dev
sudo apt-get install rubygems1.9.2

and everything's ok