0
votes

I'm getting the below error message when creating a new rails app.

Bundler::GemspecError: Could not read gem at /Users/xyz/.rvm/gems/ruby-2.1.1/cache/rdoc-4.2.0.gem. It >may be corrupted. An error occurred while installing rdoc (4.2.0), and Bundler cannot continue. Make sure that gem install rdoc -v '4.2.0' succeeds before bundling.

I am on Ruby 2.1.1 and Rails 4.1.6. I have tried:

gem install rdoc -v '4.2.0'; no change.
gem install rdoc; no change.
gem install rails; no change.
gem install rails --no-ri --no-rdoc; no change.
gem uninstall rails; elect to uninstall all versions.
gem install rails; hangs for a long time on 'installing ri documentation'.
gem uninstall rails; removes the hald installed 4.1.8 vers installed in last cmd.
gem install rails --no-ri --no-rdoc; installs without issue.
rails new new_app_name; exactly the same rdoc error issue even though I specified an install without rdoc!!

Bundler::GemspecError: Could not read gem at /Users/jamesbkemp/.rvm/gems/ruby-2.1.1/cache/rdoc->4.2.0.gem. It may be corrupted. An error occurred while installing rdoc (4.2.0), and Bundler cannot continue. Make sure that gem install rdoc -v '4.2.0' succeeds before bundling.

I seem to be stuck on this error, bundle install or update isn't doing anything to help either. Can anyone help?

Just removed the two sited instances of 'gem rdoc' from gemfile.lock, still the same issue.

2
what happens if you uninstall it and reinstall it?Ronna
I've uninstalled all versions and try to install rdoc again, gem install rdoc, and i get the following; "invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError)"jbk
I've now upgraded to Ruby 2.1.5 and rails 4.1.8 and still the same issue, any ideas on how to solve?jbk
bundler updated now, rubygems updated, still same issue.jbk

2 Answers

1
votes

FYI - Seemed to be an issues with Bundler. Removed bundler and reinstalled and all seemingly ok.

1
votes

I encountered the problem today and resolved the issue by deleting "rdoc->4.2.0.gem" from the cache folder and after that all you have to do is open command prompt and type gem install rdoc -v '4.2.0' and press enter , it will show a warning that

do you want to overwrite the executable file in bin folder (Y/N).

Type Y and press enter and you are ready for the ride.