Error in Ansible installer Consul

Hi,

I keep getting the following error when running the Ansible installer playbook for staging servers. I re-installed bundler, gems and bundler. But without success. How can I solve this?

Please help

TASK [rails : Install gems (this may take a few minutes)] **********************
fatal: [81.169.133.104]: FAILED! => changed=true
cmd: source /home/deploy/.rvm/scripts/rvm && bundle install --path /home/deploy/consul/shared/bundle --without development test
delta: ‘0:00:06.477582’
end: ‘2022-01-13 09:31:24.754804’
msg: non-zero return code
rc: 5
start: ‘2022-01-13 09:31:18.277222’
stderr: |-
[DEPRECATED] The --path flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use bundle config set path '/home/deploy/consul/shared/bundle', and stop using this flag
[DEPRECATED] The --without flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use bundle config set without 'development test', and stop using this flag
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/deploy/consul/shared/bundle/ruby/2.7.0/gems/racc-1.5.2/ext/racc/cparse
/home/deploy/.rvm/rubies/ruby-2.7.4/bin/ruby -I
/home/deploy/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0 -r
./siteconf20220113-90764-1a9zdpy.rb extconf.rb
checking for rb_ary_subseq()... yes
creating Makefile

current directory:
/home/deploy/consul/shared/bundle/ruby/2.7.0/gems/racc-1.5.2/ext/racc/cparse
make "DESTDIR=" clean

current directory:
/home/deploy/consul/shared/bundle/ruby/2.7.0/gems/racc-1.5.2/ext/racc/cparse
make "DESTDIR="
compiling cparse.c
linking shared-object racc/cparse.so

current directory:
/home/deploy/consul/shared/bundle/ruby/2.7.0/gems/racc-1.5.2/ext/racc/cparse
make "DESTDIR=" install
make: /usr/bin/mkdir: Command not found
make: *** [Makefile:202: .sitearchdir.-.racc.time] Error 127

make install failed, exit code 2

Gem files will remain installed in
/home/deploy/consul/shared/bundle/ruby/2.7.0/gems/racc-1.5.2 for inspection.
Results logged to
/home/deploy/consul/shared/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/racc-1.5.2/gem_make.out

An error occurred while installing racc (1.5.2), and Bundler cannot continue.
Make sure that `gem install racc -v '1.5.2'` succeeds before bundling.

In Gemfile:
  invisible_captcha was resolved to 2.0.0, which depends on
    rails was resolved to 5.2.6, which depends on
      actioncable was resolved to 5.2.6, which depends on
        actionpack was resolved to 5.2.6, which depends on
          actionview was resolved to 5.2.6, which depends on
            rails-dom-testing was resolved to 2.0.3, which depends on
              nokogiri was resolved to 1.12.5, which depends on
                racc

stderr_lines:
stdout: |-
Fetching gem metadata from https://rails-assets.org/
Fetching gem metadata from https://rubygems.org/
Fetching gem metadata from https://rails-assets.org/
Using rake 13.0.6
Using concurrent-ruby 1.1.9
Using i18n 1.8.10
Using minitest 5.14.4
Using thread_safe 0.3.6
Using tzinfo 1.2.9
Using activesupport 5.2.6
Using builder 3.2.4
Using erubi 1.10.0
Using mini_portile2 2.6.1
Fetching racc 1.5.2
Installing racc 1.5.2 with native extensions
stdout_lines:

Hi, @Wouter_Splinter.

Might be related to issue #147 in the racc gem, although we’ve never run into it before :thinking:. Which system is installed on the staging servers? You might want to add a comment to that issue saying you’re getting the error with Ruby 2.7.4.

As a workaround, you can create a symlink on the staging server with:

sudo ln -s /bin/mkdir /usr/bin/mkdir

I managed to get it running by doing a complete re-install of the server and running Ansible script again