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 3 years have passed since last update.

bundler 使い方

0
Posted at

概要

  • bundlerを使わない期間が長かったので使い方を忘れていた
  • 初歩的なところを調べてまとめる

参考資料:Bundlerの原理

bundlerのワークフロー

1. .Gemfileを編集

以下参照

2. bundle install でGemfileに記載しているGemと、依存関係のあるGemをすべてインストール

$ bundle install

3. .Gemfile.Gemfile.lockが衝突したとき

  • 特定のgemと、それに関連するgemをupdateする
  • これをするとgem名と依存関係にあるgemをアップデートする
  • 動作確認は必要
  • 間違えてbundle updateしないように

実際に開発する際には、複数のgemのUpdateを一度にやるのはよくないと思う
一つの機能の開発を行うときに複数のgemを明示的にバージョンアップする必要がある場合

  1. 一つのgemをアップデート
  2. 動作が良好であれば一度コミット
  3. また別のgemをアップデート
  4. 再度コミット

という流れで行えば、不具合が起きたときに影響範囲を特定しやすいと感じた(特定のリビジョンに戻して動作確認を行うことができるため)

$ bundle update <gem名>

その他のコマンド

1. bundle exec

  • .Gemfile内のすべてのGemを利用可能にし、指定しているコマンドを実行する

これ以降は必要になった際に随時調べる予定!

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?