19
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

`rubygems-update requires Ruby version >= 2.3.0` のエラーが出るとき

Last updated at Posted at 2018-12-20

TL;DR

gem update --system

を下記のように変更する

gem update --system 2.7.11
# または
gem install rubygems-update -v '<3' && update_rubygems

事象

古い Ruby を使っているプロジェクトで gem update --system を実行すると下記のようなエラーが出るようになった

$ gem update --system
Updating rubygems-update
Fetching: rubygems-update-3.0.0.gem (100%)
ERROR:  Error installing rubygems-update:
        rubygems-update requires Ruby version >= 2.3.0.
ERROR:  While executing gem ... (NoMethodError)
    undefined method `version' for nil:NilClass

原因

Ruby 2.6 のリリースに向けて RubyGems 3.0.0 がリリースされ、2.3 未満の Ruby はサポートされなくなった
gem update --system では最新版の RubyGems を取ってくるので、2.3 未満の Ruby を使っていると通らなくなる

対応

2 系の最新版 を入れるようにする

gem update --system 2.7.11
# または
gem install rubygems-update -v '<3' && update_rubygems
19
15
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
19
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?