Description
Version
1.22.1
What did you expect to happen?
I expected for the provisioning of a new Trellis project to succeed.
What actually happens?
The provisioning fails right after running the playbook during the check of an already existing ssh configuration with a following error message:
/tmp/example.com/trellis/lib/trellis/vagrant.rb:108:in `update_ssh_config': undefined method `exists?' for class File (NoMethodError)
if File.exists?(config_file)
^^^^^^^^
Did you mean? exist?
The error happens on line 108 in the following method:
trellis/lib/trellis/vagrant.rb
Lines 103 to 123 in c46ae4f
I don't know much about Ruby, but according to the following changelog, the File.exists?
method was removed from Ruby in version 3.2.0 and to my knowledge, at least on openSUSE Tumbleweed the minimum available version from the official repositories is 3.3.
The provisioning finishes just fine after replacing the failing File.exists?
method with the interpreter-suggested File.exist?
method.
trellis/lib/trellis/vagrant.rb
Line 108 in c46ae4f
Steps to reproduce
trellis new example.com
cd example.com
trellis up
System info
openSUSE Tumbleweed 20240607 x86_64
trellis-cli 1.11.1
ruby 3.3.2 (2024-05-30 revision e5a195edf6) [x86_64-linux-gnu]
Vagrant 2.3.7
Log output
==> default: Running action triggers after up ...
==> default: Running trigger...
==> default: Adding vagrant ssh-config for example.test to ~/.ssh/config
/tmp/example.com/trellis/lib/trellis/vagrant.rb:108:in `update_ssh_config': undefined method `exists?' for class File (NoMethodError)
if File.exists?(config_file)
^^^^^^^^
Did you mean? exist?
from /tmp/example.com/trellis/Vagrantfile:163:in `block (4 levels) in <top (required)>'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/plugin/v2/trigger.rb:359:in `execute_ruby'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/plugin/v2/trigger.rb:212:in `block in execute'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/plugin/v2/trigger.rb:181:in `each'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/plugin/v2/trigger.rb:181:in `execute'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/plugin/v2/trigger.rb:58:in `fire'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/action/builtin/trigger.rb:30:in `call'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/action/warden.rb:48:in `call'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/action/builder.rb:180:in `call'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/action/builtin/delayed.rb:21:in `call'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/action/warden.rb:48:in `call'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/action/builder.rb:180:in `call'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/action/runner.rb:101:in `block in run'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/util/busy.rb:19:in `busy'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/action/runner.rb:101:in `run'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/machine.rb:248:in `action_raw'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/machine.rb:217:in `block in action'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/environment.rb:631:in `lock'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/machine.rb:203:in `call'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/machine.rb:203:in `action'
from /usr/share/vagrant/gems/gems/vagrant-2.3.7/lib/vagrant/batch_action.rb:86:in `block (2 levels) in run'
exit status 1
Please confirm this isn't a support request.
Yes