How to tell what users Ruby

Polytropon freebsd at
Mon Sep 30 02:33:53 UTC 2019

On Sun, 29 Sep 2019 18:42:46 -0500, Paul Schmehl wrote:
> --On September 29, 2019 at 8:26:01 AM +0200 Polytropon <freebsd at> 
> wrote:
> > On Sun, 29 Sep 2019 01:17:52 -0500, Paul Schmehl wrote:
> >> I'm running ruby 2.4 on a server. I want to upgrade to the new default
> >> version, so I checked /usr/ports/UDPATING.
> >>
> >> Among other things, it said this: "f you wish to update to the new
> >> default  version, you need to first stop any software that uses ruby."
> >>
> >> Is there a utility I can use that will tell me that? How do I identify
> >> what  programs are using ruby?
> >
> > Yes, pkg provides a part of that functionality; check "man pkg-info"
> > for the "--required-by" (or -r) flag. Make a list of the packages
> > that depend on the currently installed Ruby version:
> >
> > 	# pkg info -r ruby
> >
> When I ran this it listed no programs. Which is kind of odd, since I know 
> portmaster uses ruby.

I've just installed portmaster for testing - you're right, it does not
show up as depending on ruby; vim, however, does:

	# pkg info -r ruby

Interesting thing: portmaster's Makefile does not mention ruby at all.
So I tried something: I removed ruby and vim and portmaster, then
installed portmaster again - and no ruby. So my guess is: portmaster
does no longer depend on ruby.

I'll now be installing vim again, and notice version changes:

        vim: 8.1.1954
        ruby: 2.6.4,1

Additionally, pkg and perl get upgraded, too. I have to say, pkg is
really great. :-)

> Anyway, I just did a pkg delete, and nothing was listed, so I deleted it 
> and installed 2.6.

Depending on the services your server runs, it should have been possible
to construct something like

	# pkg info -r ruby | something | something else | xargs -n 1 service stop

to stop the services that depend on ruby before performing the upgrade.
As others have mentioned, tools like lsof and a "non-deleting pkg delete"
would also provide information on where ruby is in use.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list