Skip to content

Instantly share code, notes, and snippets.

@fliiiix
Last active October 10, 2021 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fliiiix/ab5cc8cbf1cbd2fd5a79640d3f869285 to your computer and use it in GitHub Desktop.
Save fliiiix/ab5cc8cbf1cbd2fd5a79640d3f869285 to your computer and use it in GitHub Desktop.
Notes about Ruby 3.0 on FreeBSD

Issue

Gems don't install if you try to use:

cat /etc/make.conf 
DEFAULT_VERSIONS= ruby=3.0

The example port used to show this is devel/rubygems-racc.

ruby-gems

A patch to upgrade ruby-gems to can be found here https://gist.github.com/fliiiix/be69eb8e56ef6aac273167f469aecb26 One issue still persisting is that no spec files can be found meaing they are extracted wrong?

devel/ruby-gems should be probably be updatet to something newer or at least this patch should be applied https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253104

gem install

For some reason gem install stoped creating a spec, cache and doc dir.

A quick fix is in Mk/Uses/gem.mk to patch this:

-GEMSPEC=       ${PORTNAME}.gemspec
+GEMSPEC=       ${PORTNAME}-${PORTVERSION}.gemspec

...

 do-install:
+       @(mkdir -p ${STAGEDIR}${PREFIX}/${SPEC_DIR})
+       @(mkdir -p ${STAGEDIR}${PREFIX}/${CACHE_DIR})
+       @(mkdir -p ${STAGEDIR}${PREFIX}/${DOC_DIR})

The real fix should probably fix ? devel/ruby-gems ? in a way gem install ensures the creation of this directories at least that is the assumption since it worked for ruby27 and it works for ruby30 on linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment