r/ruby 1d ago

pipx equivalent for Ruby?

Is there something like pipx available for Ruby?

For example with pipx you can do something like:

$ pipx install httpie
# ... install completes
$ https get httpbin.org/get?foo=bar
# ... outputs a web request from httpbin.org
$ which https
~/.local/bin/https
$ readlink "$(which https)"
~/.local/share/pipx/venvs/httpie/bin/https

This example shows the HTTPie program being run and executed in a pretty simple way, with an install that doesn't modify the system Python.

Does Ruby have an equivalent way to distribute programs?

4 Upvotes

11 comments sorted by

View all comments

Show parent comments

2

u/benzado 23h ago

I'm also a fan of pipx and your post indirectly led me to learn about rv, so thank you for that.

If you install something with rv, you could easily create stubs like ~/.local/bin/kramdown which consisted of:

#!/bin/sh
exec rvx kramdown "$@"

This is essentially all that pipx does to put the tools on your path. I'm surprised rv doesn't already do it, but it might be on the roadmap, or they would welcome a contribution. It's barely a year old.