• Skip to primary navigation
  • Skip to content
  • Skip to footer
Peaceful Revolution

      Restore Gem to Original State after Bundle Open

      Experiment with Ruby Gems safely without messing it up

      December 19, 2017 less than 1 minute read

      Image by Joshua Fuller from Unsplash
      Qing Wu

      Qing Wu

      Developer ❤️ Functional Programming

      • Sydney, Australia
      • Website
      • Email
      • Twitter
      • LinkedIn
      • GitHub

      When trying to understand how a gem works,

      bundle open [gem]
      

      can be a very useful command. But after finished debugging, logging and etc., it would be awesome to be able to restore the gem you’ve messed with to its original state. Thankfully there is a command for exactly that:

      bundle exec gem pristine [gem]
      

      Reference: https://github.com/bundler/bundler-features/issues/5

      Tags: bundle, gem, ruby, tiny-tips

      Updated: May 19, 2021

      Share on

      Twitter Facebook LinkedIn
      Previous Next

      Leave a comment

      You may also enjoy

      Taking Control of Terminal Titles

      August 24, 2025 6 minute read

      One simple command to rule them all

      Red bug on green leafed plant

      The Case of Rejected Certificates: An OTP Mystery

      March 8, 2025 4 minute read

      Tracking down a production issue to a subtle bug in Erlang/OTP

      Banff National Park

      Understanding Application Configuration in Elixir

      April 18, 2024 3 minute read

      Application configuration can get interesting in Elixir. Let’s dig …

      Talimena Scenic Drive - Road in autumn forest

      Type Narrowing with Custom Functions in Typescript

      February 12, 2023 2 minute read

      Typescript has union types and there are many ways to narrow the types

      • Follow:
      • Feed
      © 2025 Peaceful Revolution. Powered by Jekyll & Minimal Mistakes.