| name | ruby-bundle-setup |
| description | Ruby environment setup and update workflow using rbenv and Bundler. Use when user asks to update Ruby environment, update rbenv, install Ruby version, run bundle install, update Gemfile.lock, or set up Jekyll/Ruby project dependencies. (user) |
Ruby Bundle Setup
rbenv and Bundler を使用した Ruby 環境のセットアップと更新ワークフロー。
Initial Setup (初回インストール)
rbenv のインストール
brew install rbenv ruby-build
zshrc の設定
~/.zshrc に以下を追加:
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init - zsh)"
設定を反映:
source ~/.zshrc
インストール確認
rbenv -v
which rbenv
Update Workflow (更新)
Step 1: rbenv の更新
brew upgrade rbenv ruby-build
Step 2: Ruby バージョンの確認とインストール
rbenv install -l
rbenv install <version>
rbenv global <version>
rbenv local <version>
rbenv rehash
Step 3: Bundler のセットアップ
gem install bundler
bundle -v
Step 4: bundle install と Gemfile.lock の更新
bundle install
bundle update
bundle update <gem-name>
Quick Reference
初回インストール:
brew install rbenv ruby-build
source ~/.zshrc
rbenv/ruby-build の更新:
brew upgrade rbenv ruby-build
日常の更新:
bundle update && bundle install