0
0

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.

RSpecのWARN: Clearing out unresolved specsのトラブルシュート

Posted at

環境

Rails5.2

内容

Rspecを実行したところ、下記のエラーが発生しました。

WARN: Unresolved or ambigious specs during Gem::Specification.reset:
      diff-lcs (>= 1.2.0, < 2.0)
      Available/installed versions of this gem:
      - 1.5.0
      - 1.4.4
WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'
Please report a bug if this causes problems.

diff-lcsというgemが、1.5.0と1.4.4の2つのバージョンでインストールされており、RSpecがどちらのバージョンを使うべきか判断つかない状態になっていることが原因のようです。

確かに、2つのバージョンが存在しています。

$gem list diff-lcs
*** LOCAL GEMS ***
diff-lcs (1.5.0, 1.4.4)

問題の解決方法は、エラーメッセージの中に書かれていました。下記のコマンドを実行すると、複数のバージョンがインストールされている場合、古いバージョンの方を削除してくれます。

gem cleanup diff-lcs

確かに、古いバージョンのgemが削除されたようです。

$ gem list diff-lcs
*** LOCAL GEMS ***
diff-lcs (1.5.0)

再び、RSpecを実行すると、エラーは発生しなくなりました。:smile:

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?