I am using asdf-ruby to install ruby 3, using chef execute.
execute 'install_ruby_with_asdf' do
command "#{asdf} install ruby #{ruby_version}"
action :run
user user
environment({ 'HOME' => deploy_dir })
not_if "#{asdf} list ruby | grep -q #{ruby_version}"
end
This process get stuck at make -j 2
and does not move forward. If I do ctrl + c
after 10-15 minutes and check in instance the ruby version is installed correctly. On checking logs I found out that make process is getting terminated because of memory issue.
ruby-build log. last few lines.
./revision.h unchanged
generating enc.mk
make: *** [uncommon.mk:863: enc.mk] Terminated
Is there any thing I can do to complete this process other than “Increasing the instance size”?
Also ruby is getting installed when command runs directly into server, without any issues.
I tried replacing chef execute with other alternatives but that didn’t worked.