`marshal data too short` error message while insta

2020-07-18 09:56发布

问题:

I have a clean installation of Windows XP (Professional, Version 2002, Service Pack 3) in VMware Fusion virtual machine (3.1.2 332101). (Host machine is MacBook Pro, Mac OS 10.6.7.) XP installation has 512 MB RAM and is fully updated, except I left Internet Explorer at version 6.

I have installed Ruby and RubyGems:

C:\Documents and Settings\zeljko>gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.6.2
  - RUBY VERSION: 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby187/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: C:/Ruby187/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/Ruby187/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - C:/Ruby187/lib/ruby/gems/1.8
     - C:/Documents and Settings/zeljko/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

When I try to install watir-webdriver gem, I get this error message:

C:\Documents and Settings\zeljko>gem install watir-webdriver
ERROR:  While executing gem ... (ArgumentError)
    marshal data too short

I am searching around, but did not find the solution yet.

回答1:

jarib suggested I should delete .gem folder (C:\Documents and Settings\zeljko\.gem) and it fixed the problem.



回答2:

If the problem remains

Reinstall all the gems:

sudo gem list | cut -d" " -f1 > gem_list.txt

cat gem_list.txt | xargs sudo gem uninstall -aIx

cat gem_list.txt | xargs sudo gem instal


回答3:

Delete .gem folder in directory which is hidden..