1
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.

【Rails】gemの削除・バージョン変更方法

1
Last updated at Posted at 2024-03-06

記事概要

gemの削除・バージョン変更方法についてです。
※自分は「bundler」を使っているので「bundle exec」を加えてのコマンド紹介になっています。
(bundleは、Rubyで使用されるGemの管理ツールです。)

gemの削除方法

$ bundle exec gem uninstall 消したいgem名

    ⬇︎
Gemfileから消したいgemを削除
    ⬇︎

$ bundle install

以上でGemfile.lockからも消えます。

・具体例(「sorcery」と言うgemを消す場合)

$ bundle exec gem uninstall sorcery

    ⬇︎
Gemfileから今回消したいgem = 「sorcery」 を削除
    ⬇︎

$ bundle install

gemのバージョン変更方法

バージョン変更はまず上記で紹介したように「元々あるgem」を削除した上で、Gemfileで「インストールしたいバージョン」を記述すればいいだけです。

元々あるバージョンを変えたいgemを削除
    ⬇︎
Gemfileにインストールしたいバージョンをのgemを追加
例:gem 'sorcery', "0.16.3"
    ⬇︎

$ bundle install
1
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
1
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?