FWIW...
I noticed that after rebuilding the container with rbtrace
stripped out of the Gemfile, inside the container were gem lib files for rbtrace 0.5.0
, I assume from the Discourse docker base image.
root@discourse-socket1:/var/www/discourse# grep -r "rbtrace" . | grep -v vendor
grep: ./vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.0/ext/libmsgpackc_ext.a: binary file matches
grep: ./vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.0/ext/src/msgpack-1.1.0/src/vrefbuffer.o: binary file matches
grep: ./vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.0/ext/src/msgpack-1.1.0/src/objectc.o: binary file matches
grep: ./vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.0/ext/src/msgpack-1.1.0/src/version.o: binary file matches
grep: ./vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.0/ext/src/msgpack-1.1.0/src/.libs/libmsgpackc.a: binary file matches
grep: ./vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.0/ext/src/msgpack-1.1.0/src/.libs/libmsgpack.a: binary file matches
grep: ./vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.0/ext/src/msgpack-1.1.0/src/unpack.o: binary file matches
grep: ./vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.0/ext/src/msgpack-1.1.0/src/zone.o: binary file matches
grep: ./vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.0/ext/dst/lib/libmsgpackc.a: binary file matches
...
...
So, I tried the same method as above, but this time specifying:
- sed -i '/rbtrace/d' Gemfile
- sed -i '/rbtrace/d' Gemfile.lock
- echo "gem 'rbtrace', '= 0.5.0'" >> Gemfile
and it compiled with rbtrace
as it should.
...
...
Using redis-namespace 1.11.0
Using pry 0.14.2
Using puma 6.4.0
Using net-http 0.4.0
Using rbtrace 0.5.0 # <--- here is it! working when gem specified exact version
Using oauth-tty 1.0.5
Using snaky_hash 2.0.1
Using rqrcode 2.2.0
Using rss 0.3.0
Using loofah 2.22.0
Using unicorn 6.1.0
Using net-imap 0.4.8
Using net-pop 0.1.2
Using net-smtp 0.4.0
...
...
This means that the problem is more than likely that rbtrace version 0.5.0
is included in the base discourse docker image (which is pulled when installing), but the discourse gem file does not specific that version number so it pulls version 0.5.1 causing a build error when bundling the gems. Fairly basic stuff.
So, this fix works (in the current discourse version) added to the build .yml
file:
- sed -i '/rbtrace/d' Gemfile
- sed -i '/rbtrace/d' Gemfile.lock
- echo "gem 'rbtrace', '= 0.5.0'" >> Gemfile
However, this fix will fail when discourse updates rbtrace
in their docker images, unless they also update their Gemfile (or they get lucky and the version in their docker image matches the version requested in the gem file).
So, that is the full take on this error.
Successfully bootstrapped, to startup use ./launcher start socket3
So, this is a Discourse build error, for sure and nothing to do with the OS, docker, etc, in my view; because specifying the correct version in the Gemfile which matches the docker image pulled during install solves this problem.
Merry Christmas!