26

I'm trying to install Rails 3 on a new OS X Snow Leopard machine (with dev tools installed), and when I sudo gem install rails, I get the following error:

ERROR:  While executing gem ... (Gem::FormatException)
builder-2.1.2 has an invalid value for @cert_chain

And the update fails. Has anyone seen this before? I greped the builder-2.1.2 directory for 'cert_chain,' but couldn't find any clues.

Ruby version is 1.8.7

OS X 10.6.6

Thanks!

14 Answers 14

28

This is an issue with Rubygems version 1.7.1. Upgrading to 1.7.2 or above, or downgrading to 1.6.2, fixes this.

To upgrade (preferred):

gem update --system

To downgrade:

gem update --system 1.6.2
26

Check your gem version by

gem -v

If it is 1.7.1 than downgrade rubygems by following command

gem update --system 1.6.2

It seems that new rubygem version(1.7.1) is not working with some versions of Ruby. So downgrade it.

1
  • 3
    1.7.2 works, as outlined in other answers, so downgrading is no longer the only way to solve this problem. Jun 6, 2011 at 14:34
2

I was able to fix this by updating ruby to 1.9.2p180. (on windows)

1
  • 2
    I'm running 1.9.2p180 and I'm getting this error regardless. (On Linux) Apr 2, 2011 at 2:12
2

sudo gem update --system 1.6.2

1

I had the same error when trying to install rails, I agree with evan.leonard I think it a bug with v1.7.1. I downgraded rubygems to 1.6.2 and it worked, here is how to downgrade...

gem update --system 1.6.2

1

Worked like a charm on SL 10.6.7. Fixed my problem with getting Vagrant to install.

gem update --system 1.6.2

1

Had the same problem on Ubuntu 10.04 while upgrading to Rails 3:

Installing abstract (1.0.0) /usr/local/lib/ruby/site_ruby/1.8/rubygems/specification.rb:371:in `initialize_copy': abstract-1.0.0 has an invalid value for @cert_chain (Gem::FormatException)

sudo gem update --system 1.6.2 solved the problem

1

Received similar error when running "bundle install" when creating new RoR application using Ruby 1.9.2 and Rails 3.0.3 and Rubygems 1.8.10.

Fix: downgrading Rubygems from 1.8.10 to 1.8.9

0

I see the exact same thing on a virgin install of rails on Amazon Linux (v 2010.11) with Ruby 1.8.7 and RubyGems 1.7.1.

    # gem install rails --backtrace
ERROR:  While executing gem ... (Gem::FormatException)
    builder-2.1.2 has an invalid value for @cert_chain
        /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:371:in `initialize_copy'
        /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:360:in `each'
        /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:360:in `initialize_copy'
        /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:638:in `dup'
        /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:638:in `for_cache'
        /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:746:in `to_ruby_for_cache'
        /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:234:in `write_spec'
        /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:175:in `install'
        /usr/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:299:in `install'
        /usr/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:270:in `each'
        /usr/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:270:in `install'
        /usr/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:120:in `execute'
        /usr/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:115:in `each'
        /usr/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:115:in `execute'
        /usr/lib/ruby/site_ruby/1.8/rubygems/command.rb:278:in `invoke'
        /usr/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:133:in `process_args'
        /usr/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:103:in `run'
        /usr/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:64:in `run'
        /usr/bin/gem:21
0

As a workaround I was able to install rails by commenting out line 371 in rubygems/specification.rb ("raise e"). (This is with rubygems 1.7.1.)

0

Well, I just downloaded it from: http://rubygems.org/pages/download

and then ran setup.rb in the extracted directory and then re-ran 'gem install rails'. (both with sudo if using an environment that needs it)

0

I downgraded to rubygems 1.6.2 and this worked for me too. 1.7.1 seems to have a bug or something.

0

Having the same issue on Rackspace cloud servers, going to 1.7.1 introduced the error message -- going back to 1.6.2 it went away.

0

Had the same problem with gem Version 1.7.2. But updating on 1.8.9 fixed it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.