下記のようなエラーが出たとき
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