ruby 27 has been updated from ruby31

Hello.
System FreeBSD 13.1-RELEASE-p7 amd64
Updating ruby.
pkg delete -f ruby27 portupgrade ruby27-bdb
Install portupgrade.
make -C /usr/ports/ports-mgmt/portupgrade install clean
Error.
Code:
# make -C /usr/ports/ports-mgmt/portupgrade install clean
===>  Staging for portupgrade-2.4.16,2
===>   portupgrade-2.4.16,2 depends on file: /usr/local/bin/ruby31 - found
===>   portupgrade-2.4.16,2 depends on file: /usr/local/lib/ruby/site_ruby/3.1/amd64-freebsd13/bdb.so - not found
===>   ruby31-bdb-0.6.6_8 depends on package: rubygem-rdoc>=0.a - not found
===>  License GPLv2 RUBY accepted by the user
===>   rubygem-rdoc-6.5.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by rubygem-rdoc-6.5.0 for building
===>  Extracting for rubygem-rdoc-6.5.0
=> SHA256 Checksum OK for rubygem/rdoc-6.5.0.gem.
===>   rubygem-rdoc-6.5.0 depends on file: /usr/local/bin/ruby31 - found
===>   rubygem-rdoc-6.5.0 depends on file: /usr/local/bin/gem - not found
===>   rubygem-rdoc-6.5.0 depends on file: /usr/local/bin/gem - not found
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/devel/rubygem-rdoc
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/databases/ruby-bdb
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/databases/ruby-bdb
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/ports-mgmt/portupgrade
*** Error code 1

Stop.
make: stopped in /usr/ports/ports-mgmt/portupgrade
How to fix it?
Code:
pkg version -v | grep 'ruby'
ruby-3.1.3_2,1                     =   up-to-date with index
 
Please read /usr/ports/UPDATING
Code:
20230315:
  AFFECTS: users of lang/ruby30
  AUTHOR: yasu@FreeBSD.org

  The default ruby version has been updated from 3.0 to 3.1.

  If you compile your own ports you may keep 3.0 as the default version by
  adding the following lines to your /etc/make.conf file:

  #
  # Keep ruby 3.0 as default version
  #
  DEFAULT_VERSIONS+=ruby=3.0

  If you wish to update to the new default version, you need to first stop any
  software that uses ruby. Then, you will need to follow these steps, depending
  upon how you manage your system.

  If you use pkg, simply upgrade:
  # pkg upgrade

  If you do not use pkg, please check entry 20190420.
  The description there should also work for this version.
Code:
20220421:
  AFFECTS: users of lang/ruby27
  AUTHOR: yasu@FreeBSD.org

  The default ruby version has been updated from 2.7 to 3.0.

  If you compile your own ports you may keep 2.7 as the default version by
  adding the following lines to your /etc/make.conf file:

  #
  # Keep ruby 2.7 as default version
  #
  DEFAULT_VERSIONS+=ruby=2.7

  If you wish to update to the new default version, you need to first stop any
  software that uses ruby. Then, you will need to follow these steps, depending
  upon how you manage your system.

  If you use pkg, simply upgrade:
  # pkg upgrade

  If you do not use pkg, please check entry 20190420.
  The description there should also work for this version.
Code:
20190420:
  AFFECTS: users of lang/ruby24
  AUTHOR: mfechner@FreeBSD.org

  The default ruby version has been updated from 2.4 to 2.5.

  If you compile your own ports you may keep 2.4 as the default version by
  adding the following lines to your /etc/make.conf file:

  #
  # Keep ruby 2.4 as default version
  #
  DEFAULT_VERSIONS+=ruby=2.4

  If you wish to update to the new default version, you need to first stop any
  software that uses ruby. Then, you will need to follow these steps, depending
  upon how you manage your system.

  If you use pkgng, simply upgrade:
  # pkg upgrade

  If you use portmaster, install new ruby, then rebuild all ports that depend
  on ruby:
  # portmaster -o lang/ruby25 lang/ruby24
  # portmaster -R -r ruby-2.5

  If you use portupgrade, install new ruby, then rebuild all ports that depend
  on ruby:

  # pkg delete -f ruby portupgrade
  # make -C /usr/ports/ports-mgmt/portupgrade install clean
  # pkg set -o lang/ruby24:lang/ruby25
  # portupgrade -x ruby-2.5.\* -fr lang/ruby25
 
Yeah, posted that and realized it was wrong. Looks like you have some odd mishmash of different Ruby versions installed.
 
Yeah, posted that and realized it was wrong. Looks like you have some odd mishmash of different Ruby versions installed.
Mishmash of different Ruby versions ?
pkg version -v | grep 'ruby'
ruby-3.1.3_2,1 = up-to-date with index
Only one version 3.1, which was installed by portupgrade dependencies.
 
Rich (BB code):
===>   ruby31-bdb-0.6.6_8 depends on package: rubygem-rdoc>=0.a - not found
===>  License GPLv2 RUBY accepted by the user
===>   rubygem-rdoc-6.5.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by rubygem-rdoc-6.5.0 for building
===>  Extracting for rubygem-rdoc-6.5.0
=> SHA256 Checksum OK for rubygem/rdoc-6.5.0.gem.
===>   rubygem-rdoc-6.5.0 depends on file: /usr/local/bin/ruby31 - found
===>   rubygem-rdoc-6.5.0 depends on file: /usr/local/bin/gem - not found
===>   rubygem-rdoc-6.5.0 depends on file: /usr/local/bin/gem - not found
*** Error code 1

/usr/local/bin/gem is provided by devel/ruby-gems

Install that port first.
 
/usr/local/bin/gem is provided by devel/ruby-gems
install ruby-gems
Then I started it again rebuild make -C /usr/ports/ports-mgmt/portupgrade install clean,build finished fine.
pkg version -v | grep 'ruby'
ruby-3.1.3_2,1 = up-to-date with index
ruby31-bdb-0.6.6_8 = up-to-date with index
ruby31-gems-3.4.5 = up-to-date with index
rubygem-psych-5.0.2 = up-to-date with index
rubygem-rdoc-6.5.0 = up-to-date with index
rubygem-stringio-3.0.4 = up-to-date with index
It is not clear why rubygem is needed with version 3.1 of ruby.
Need to fix port portupgrade so that it installs according to ruby-gems dependencies.
 
The gem is not actually needed; for a long time already the gem stuff is contained in the base ruby package. The ruby-gems port does only exist because the other gem ports depend on it, and so there must be something they can depend on.
I for my part have patched the ruby-gems port to be empty and only install the "gem" stub executable. Seems to work:
Code:
$ pkg list ruby30-gems
/usr/local/bin/gem
$ cat /usr/local/bin/gem
#!/usr/local/bin/ruby30
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++

require "rubygems"
require "rubygems/gem_runner"

args = ARGV.clone

Gem::GemRunner.new.run args

If you install ruby-gems as it is, you get one gem version from that, and one additional gem version in every ruby package, and nobody knows what is used.
The port maintainer should tidy this up; I think I talked to them once, but somehow it went the usual way.
 
My system: FreeBSD 12.4-RELEASE-p1

I struggled with this update. I got my updates installed before I found this thread, but I wanted to see if I did it right, or if I could have done it a better way.
The first thing I saw was the notice in /usr/ports/UPDATING (SirDice posted these above). So, I read the 20190420 entry and did:
Code:
# pkg delete -f ruby portupgrade
# make -C /usr/ports/ports-mgmt/portupgrade install clean

But installing portupgrade failed with errors. So then I did:

Code:
# pkg set -o lang/ruby30:lang/ruby31
Change origin from lang/ruby30 to lang/ruby31 for all dependencies? [y/N]: y

# pkg delete -f ruby30-gems-3.4.5
 
# cd /usr/ports/devel/ruby-gems
# make install clean

That worked fine. But installing portupgrade still complained about ruby-bdb so I did this next:

Code:
# cd /usr/ports/databases/ruby-bdb
# make install clean
...
cd: /usr/ports/databases/ruby-bdb/work/bdb-0.6.6/docs/doc: No such file or directory
*** Error code 2

Stop.
make[1]: stopped in /usr/ports/databases/ruby-bdb
*** Error code 1

Stop.
make: stopped in /usr/ports/databases/ruby-bdb

I'm not sure what happened there or why it couldn't find those files, but I did # make config and the unchecked both "Build and/or install documentation" and "Build and/or install examples". THEN it installed fine.
Next, I did:

Code:
# cd /usr/ports/ports-mgmt/portupgrade
# make install clean

and OMG it installed!! FINALLY I did:

Code:
# portupgrade -x ruby-3.1.\* -fr lang/ruby31

Was there an easier way? Did I do any of this wrong?

Oh and apparently ruby27 still exists on my system. Can I safely delete it?
Code:
# pkg info -x ruby
ruby-3.1.3_2,1
ruby27-2.7.7,1
ruby31-bdb-0.6.6_8
ruby31-gems-3.4.7
rubygem-psych-5.1.0
rubygem-rdoc-6.5.0
rubygem-stringio-3.0.5

Thanks!
 
Back
Top