How to open local installed gems

#ruby #rails #open #installed #gems

This is a summary of the following Twitter thread and I also added some of my ideas:

# 1️⃣ If you want to open an installed gem gem open actionview -e code # ▶️ or if you have set in your terminal $EDITOR or $VISUAL gem open actionview # ▶️ If you are inside a project that used Gemfile and has Gemfile.lock bundle open actionview # to open the specific gem version from that project # 2️⃣ If you did changes and want to reset gem pristine actionview # to restore the gem to its cached version bundle pristine # to restore the bundled gems to their cached version bundle install --redownload # will redownload all bundled gems

Here is the text if you want to copy and paste it:

# 1️⃣ If you want to open an installed gem

gem open actionview -e code

# ▶️ or if you have set in your terminal $EDITOR or $VISUAL gem open actionview

# ▶️ If you are inside a project that used Gemfile and has Gemfile.lock

bundle open actionview

# 2️⃣ If you did changes and want to restore gem to its cached version

gem pristine actionview

bundle pristine

bundle install --redownload # will redownload all bundled gems

Reply

or to participate.