4

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.

DevanB
  • 377
  • 1
  • 6
  • 16
  • 1
    Some more info would be useful - what OS are you using? If RVM, run `rvm info` and paste the result; else run `ruby -v` , `gem env` and `which ruby; which gem; which rake` and paste the result. – Jits Jun 01 '11 at 15:11
  • check all your ~/.whatever files, also maybe clear some of your gem dirs? uninstall other versions of ruby? – rogerdpack Jun 01 '11 at 18:22
  • `ruby -v` `ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]` – DevanB Jun 02 '11 at 02:19
  • `gem env` `RubyGems Environment: - RUBYGEMS VERSION: 1.3.5 - RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] - INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8 - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby` – DevanB Jun 02 '11 at 02:22
  • `- EXECUTABLE DIRECTORY: /usr/bin - RUBYGEMS PLATFORMS: - ruby - universal-darwin-10` – DevanB Jun 02 '11 at 02:23
  • `- GEM PATHS: - /Library/Ruby/Gems/1.8 - /Users/devanb/.gem/ruby/1.8 - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8` – DevanB Jun 02 '11 at 02:24
  • `- GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://gems.rubyforge.org/` – DevanB Jun 02 '11 at 02:25
  • Also when I opened up terminal I got the following: `-bash: ./Users/devanb/.bashrc: No such file or directory` – DevanB Jun 02 '11 at 02:26
  • Sorry, I'm using Mac OS X Snow Leopard also – DevanB Jun 02 '11 at 02:39
  • Is it possible to reinstall or repair the native rails installation on Mac OS X? – DevanB Jun 02 '11 at 02:40

2 Answers2

6

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.

Joshua
  • 5,336
  • 1
  • 28
  • 42
2

Change the source in your gemfile to:

source 'https://rubygems.org'

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

Klaus
  • 903
  • 8
  • 19