Ruby on Rails TypeError

2019-06-23 17:46发布

问题:

I have been working on a ruby on rails application and ran into the following error when doing just about anything, including installing a gem, updating the bundle, installing the bundle.

ERROR: While executing gem ... (TypeError) incompatible marshal file format (can't be read) format version 4.8 required; 31.139 given

I have uninstalled RVM and completely removed all files from it, then tried to install a gem, but still get the same error.

回答1:

I had this exact problem, and it took me forever to figure it out. To fix it, I ran the following command:

bundle install --full-index

My guess is that I ended up with a corrupted rubygems index after my computer locked up, and this command forces a fresh download of the index.

Hopefully this helps someone who runs into this.



回答2:

Change the source in your gemfile to:

source 'https://rubygems.org'

https://github.com/grosser/parallel_tests/pull/183