Short Ruby Newsletter

Share this post

How to open local installed gems

newsletter.shortruby.com
Code Summaries

How to open local installed gems

#ruby #rails #open #installed #gems

Lucian Ghinda
Oct 6, 2022
2
Share this post

How to open local installed gems

newsletter.shortruby.com

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

Twitter avatar for @robbyrussell
robbyrussell.rb @robbyrussell
I believe gem open to be one of the least utilized commands to run by RoR developers. No need to browse the source code online. You can load it up in your favorite editor like so.
Image
4:45 PM ∙ Sep 28, 2022
83Likes9Retweets
# 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

Share this post

How to open local installed gems

newsletter.shortruby.com
Previous
Next
Comments
TopNewCommunity

No posts

Ready for more?

© 2023 Lucian Ghinda
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing