problem with Rails on Leopard

hi,

i have problem with Rails

when i written this command:

$ sudo gem install rails

i see this error message:

ERROR: Error installing rails:   invalid gem format for /Library/Ruby/Gems/1.8/cache/ activesupport-2.1.0.gem

???

please help me..

Just curious, don't know if it will help but, did you upgrade to the lastest version of gem ? If not maybe you should try.

hello David

thanks for ur post

before this problem i written

$ sudo gem update

then i see this message:

Updating installed gems Updating actionmailer ERROR: While executing gem … (Gem::InstallError)

invalid gem format for /Library/Ruby/Gems/1.8/cache/activesupport-2.1.0.gem

how can i solve this problem?

What David was asking was what version if gem are you using?

Type 'gem --version' The latest is 1.2 and has some changes that may be the cause of your 'invalid format' issue. If you need to upgrade gem itself, the command is 'gem update --system'

Hi Cynthia,

I have the latest version of gem 1.2.0

Is there any solutions to this problem?

Sorry. I am on Leopard with gem 1.2.0 AND all the 2.1 Rails-related gems. I didn't have any trouble installing. If it works now, perhaps there were some intermittent issues - network or on the gem server? Sorry, no ideas.

hello David

thanks for ur post

before this problem i written

$ sudo gem update

then i see this message:

Updating installed gems Updating actionmailer ERROR: While executing gem … (Gem::InstallError) invalid gem format for /Library/Ruby/Gems/1.8/cache/activesupport-2.1.0.gem

how can i solve this problem?

Have you tried removing the troublesome gems and re-installing?

Best.

Mike

Hi Mike

How can i do that?

gem help command

This will give a list of all the gem commands.

gem help uninstall

will give you the help for the uninstall command.

Best.

Mike

Hi Mike

I re-installed all gem by uninstall commands

but when i tried to install Rails by this commond

$ sudo gem install -y rails

i see this message:

sudo gem install -y rails Password: INFO: gem install -y is now default and will be removed INFO: use --ignore-dependencies to install only the gems you list Bulk updating Gem source index for: http://gems.rubyforge.org/

Updating metadata for 13 gems from http://gems.rubyonrails.org/ … complete ERROR: Error installing rails:

invalid gem format for /opt/local/lib/ruby/gems/1.8/cache/activesupport-2.1.0.gem

i tried to change the permission for activesupport-2.1.0.gem to (read & write), but no change.

i learned from this tutorial: http://www.buildingwebapps.com/articles/17-setting-up-rails-on-leopard-mac but there some problem with this way.

i will re-install MacPort…

maybe that can be solve the problem.

any solutions?

Hi Abdulrhman,

I have the same problem and here is how i managed to make it work.

I first delete the problem gem file from the directory '/Library/Ruby/ Gems/1.8/cache'

$sudo rm -rf /Library/Ruby/Gems/1.8/cache/activesupport-2.1.0.gem

the i copy the file from my other Linux box (which installed the Rails 2.1) to this directory.

If you are using Ubuntu the file will be in the directory /usr/lib/ruby/gems/1.8/cache

then i run $sudo gem install rails

Hope that help,

-- bc1806

Hi bc1806

thank you for your help,

i install ActiveSupport Manually from RubyForge then i replace the old file with it, then i run this command: $sudo gem install rails

thanks for all.

for more information: http://weblog.rubyonrails.org/2008/6/1/rails-2-1-time-zones-dirty-caching-gem-dependencies-caching-etc *read the comments.