LoginSignup
8
2

More than 3 years have passed since last update.

gemを使うときに変なエラーが出たら (ERROR: While executing gem ... (TypeError) incompatible marshal file format (can't be read) format version 4.8 required; 60.33 given)

Last updated at Posted at 2019-02-22

下記のようなエラーが出たとき

gem install bundler
ERROR:  While executing gem ... (TypeError)
    incompatible marshal file format (can't be read)
    format version 4.8 required; 60.33 given
gem update --system
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    server did not return a valid file (http://gems.rubyforge.org/specs.4.8.gz)

解決法

sourcesが古いからだった

gem env
RubyGems Environment:
...
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/
     - http://gems.github.com
...

なので、

# 下記2つのソースを削除
gem sources -r http://gems.rubyforge.org/
gem sources -r http://gems.github.com

# 追加
gem sources -a https://rubygems.org/

# 確認
gem sources -l                       
*** CURRENT SOURCES ***

https://rubygems.org/

で解決

ここでも役立っていた😁
https://github.com/rubygems/rubygems/issues/1589#issuecomment-466381653

8
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
2