ruby_select is broken

Christopher Nielsen mascguy at rochester.rr.com
Sun Oct 3 14:12:53 UTC 2021


> The ruby_select portile just has:
> 
> destroot {
> 	select::install ruby ${filespath}/base
> 	select::install ruby ${filespath}/none
> }
> 
> which does not redirect the commands “ruby” or “gem” to the appropriate version when you have installed the port “ruby27” for example. Instead, “which ruby” or “which gem” always finds the Apple version of Ruby, which is now deprecated according to the Catalina Release Notes…

Hmmm, it’s working fine for me.

Starting from the default case, where nothing has been selected yet:

$ ll $(which ruby)
-r-xr-xr-x  1 root  wheel  restricted,compressed   51K Jul  9 18:40:13 2020 /usr/bin/ruby
$ ll $(which gem)
-r-xr-xr-x  1 root  wheel  restricted,compressed  596B Jul 15 17:58:00 2017 /usr/bin/gem

After selecting ruby30:

$ sudo port select ruby ruby30
Selecting 'ruby30' for 'ruby' succeeded. 'ruby30' is now active.
$ ll $(which ruby)
lrwxr-xr-x  1 root  admin  -   22B Oct  3 09:54:35 2021 /opt/local/bin/ruby -> /opt/local/bin/ruby3.0
$ ll $(which gem)
lrwxr-xr-x  1 root  admin  -   21B Oct  3 09:54:35 2021 /opt/local/bin/gem -> /opt/local/bin/gem3.0

After selecting ruby27:

$ sudo port select ruby ruby27
Selecting 'ruby27' for 'ruby' succeeded. 'ruby27' is now active.
$ ll $(which ruby)
lrwxr-xr-x  1 root  admin  -   22B Oct  3 09:55:14 2021 /opt/local/bin/ruby -> /opt/local/bin/ruby2.7
$ ll $(which gem)
lrwxr-xr-x  1 root  admin  -   21B Oct  3 09:55:14 2021 /opt/local/bin/gem -> /opt/local/bin/gem2.7

And finally, after reverting back to no selection:

$ sudo port select ruby none
Selecting 'none' for 'ruby' succeeded. 'none' is now active.
$ ll $(which ruby)
-r-xr-xr-x  1 root  wheel  restricted,compressed   51K Jul  9 18:40:13 2020 /usr/bin/ruby
$ ll $(which gem)
-r-xr-xr-x  1 root  wheel  restricted,compressed  596B Jul 15 17:58:00 2017 /usr/bin/gem

So this isn’t working for you on macOS Catalina…?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20211003/26e8dfaf/attachment.htm>


More information about the macports-users mailing list