Howto run a postInstall check for a ruby bundlerApp

Today I just wanted to try jekyill on my 21.05 and ran into problems

nix-env -i jekyll
installing ‘jekyll-4.2.0’
building ‘/nix/store/pnggappkzyszah1hwi2rx3v12zfmjcxj-user-environment.drv’…
niklaus@librem /etc/nixos > jekyll --version
Traceback (most recent call last):
9: from /nix/store/wq648yx13sydy2jwjcv9p75xrqvbshv6-jekyll-4.2.0/bin/.jekyll-wrapped:18:in <main>' 8: from /nix/store/rdyzx8nqjbb2bnlqm8p8963czq3iridx-bundler-2.1.4/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler.rb:149:in setup’
7: from /nix/store/rdyzx8nqjbb2bnlqm8p8963czq3iridx-bundler-2.1.4/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:20:in setup' 6: from /nix/store/rdyzx8nqjbb2bnlqm8p8963czq3iridx-bundler-2.1.4/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:101:in block in definition_method’
5: from /nix/store/rdyzx8nqjbb2bnlqm8p8963czq3iridx-bundler-2.1.4/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/definition.rb:226:in requested_specs' 4: from /nix/store/rdyzx8nqjbb2bnlqm8p8963czq3iridx-bundler-2.1.4/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/definition.rb:237:in specs_for’
3: from /nix/store/rdyzx8nqjbb2bnlqm8p8963czq3iridx-bundler-2.1.4/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/definition.rb:170:in specs' 2: from /nix/store/rdyzx8nqjbb2bnlqm8p8963czq3iridx-bundler-2.1.4/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/spec_set.rb:80:in materialize’
1: from /nix/store/rdyzx8nqjbb2bnlqm8p8963czq3iridx-bundler-2.1.4/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/spec_set.rb:80:in map!' /nix/store/rdyzx8nqjbb2bnlqm8p8963czq3iridx-bundler-2.1.4/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/spec_set.rb:86:in block in materialize’: Could not find concurrent-ruby-1.1.8 in any of the sources (Bundler::GemNotFound)

As I really want to have a OS with both reproducible AND working packages, I would appreciate if somebody could mentor me into howto add a checkPhase when creating a bundler app.

I ran into this problem already with Added ruby gem postrunner by ngiger · Pull Request #113317 · NixOS/nixpkgs · GitHub

The problem does look for me (with my very limited knowledge) of nix a bit convoluted as I discovered when attacking a different problem, that using buildcommand in a mkDerivation disables phases like postInstall,checkPhase.

Where do I have to begin patching? Any hints appreciated.

My problem with jekyll was caused by an old, outdated ~/.bundle/config.
Removing it solved my problem.