1

I will try to explain my question with an example. The contents of my ~./default-gems are:

gem-ctags
dip
bundler
gem-browse
pry
pry-byebug
pry-doc
pry-theme
rubocop
rubocop-performance
rubocop-rake
rubygems-update
ruby-debug-ide
ruby_parser
seeing_is_believing
solargraph
sqlint

This setup is working fine for me but I was wondering if there is a way to use the gems associated with my latest runtime (currently ruby 3.2.0-dev) when working with older runtimes and/or if it would pose compatibility issues.

If not for all global gems, at least for some of them, would it be safe to uninstall those associated with older runtimes?

Thank you

  • Take a look at `bundler` and what it can do to manage project dependencies. – Konstantin Strukov Jun 12 '22 at 19:37
  • I already use bundler to manage project dependencies. My question is general, I used a Ruby project as an example – Ezequiel Birman Jun 14 '22 at 02:18
  • Great question, thank you. Running into similar issues with Node.js. We'd like to have some tools like pino-pretty available globally, & use latest or use the "system" node.js or some such. Ideally without having to modify our many many projects. – rektide Jun 23 '22 at 15:51

1 Answers1

0

It seems that it is safe to remove global packages associated with older runtimes as long as I keep those installed with the lastest runtime. Then I can configure a project as usual, remembering to add the latest runtime at the end.

asdf local <plugin> <project version> <latest installed version> creates a .tool-versions file declaring that. For example, for a Ruby project I am testing, the .tool-versions contents are:

ruby 2.6.6 3.2.0-dev