Change a non-default gem to a default gem in your local environment.
$ gem install gem-default
gem default xxx after
gem install xxx.
Usually, we cannot use a non-default gem (
pry for example) with
if it's not written in Gemfile.
$ cat Gemfile source 'https://rubygems.org' gem 'rails' $ gem install pry Successfully installed pry-0.12.2 Parsing documentation for pry-0.12.2 Done installing documentation for pry after 0 seconds 1 gem installed $ bundle exec pry bundler: failed to load command: pry (/home/k0kubun/.rbenv/versions/ruby/bin/pry) Gem::Exception: can't find executable pry for gem pry. pry is not currently included in the bundle, perhaps you meant to add it to your Gemfile? /home/k0kubun/.rbenv/versions/ruby/lib/ruby/2.7.0/bundler/rubygems_integration.rb:378:in `block in replace_bin_path' /home/k0kubun/.rbenv/versions/ruby/lib/ruby/2.7.0/bundler/rubygems_integration.rb:406:in `block in replace_bin_path' /home/k0kubun/.rbenv/versions/ruby/bin/pry:23:in `<top (required)>'
gem default command, you can make it available under
$ gem default pry (..snip...) => Copying files from "/home/k0kubun/.rbenv/versions/ruby/lib/ruby/gems/2.7.0/gems/pry-0.12.2/bin" to: /home/k0kubun/.rbenv/versions/ruby/bin/pry (original => /home/k0kubun/.rbenv/versions/ruby/bin/pry.old) $ cat Gemfile source 'https://rubygems.org' gem 'rails' $ bundle exec pry  pry(main)>
- Own your risk. This gem may break your Ruby installation.
- This does not support gems having non-
*.rbfiles under "lib" yet.
- Patches welcomed.
The gem is available as open source under the terms of the MIT License.