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?

特定のGemをupdateする方法

Posted at

概要

RubyonRails・Dockerを使用したプロダクトにおいてrubocopというGemをbundle update rubocopしようとしたら、versionが上がらず、parallelparserというものしか上がらず、versionを上げたいrubocopが上がらなかった。
今回は最新である1.71.2にあげます。(この記事執筆日において最新)

解決方法(2パターン)

docker環境なので

docker compose up 
docker compose exec コンテナ名 bash

これでコンテナの中に入り、以下のパターンを試してください。

1パターン目

一度消してから再度入れ直す。

bundle remove rubocop
bundle add rubocop --version 1.71.2

2パターン目

正直こちらは何も変わりませんでした。他の記事だと上がるらしいですが、このプロダクトでは何んの変化もありませんでした。なので私的にはパターン1を推奨します。これでできたという人は教えていただけると幸いです。

bundle update --conservative rubocop

追記

gem "rubocop-airbnb", "~> 5.0"

image.png

というものが入っており、エラーが出ました。その場合、後ろの, "~> 5.0"を消してあげましょう。その後、再度、addupdateをしてあげる。

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?