Bad gateway /kernel_require.rb:29:in `require': cannot load such file -- rails/commands

I have the same issue: Upgrade from 6.0.X to 6.1 system is broken

How can I connect /usr/bin/env to ruby?