Capistrano picking old Ruby version after updating 2.5.1 to 3.0.4

58 views Asked by At

I recently updated my Ruby on Rails application from Ruby version 2.5.1 to 3.0.4. I made sure to update the Ruby version in deploy.rb and config/deploy/production.rb files. However, when I try to deploy the application using the cap production deploy command, Capistrano is still picking up the old Ruby version (2.5.1), and I'm encountering the following error:

rvm 1.29.9 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
ruby-2.5.1
ruby exit status: 1 (SSHKit::Runner::ExecuteError)
ruby stdout: Nothing written
ruby stderr: Unknown ruby interpreter version (do not know how to handle): 3.0.4.
Unknown ruby interpreter version (do not know how to handle): 3.0.4.
Ruby 3.0.4 is not installed.

I've already confirmed that Ruby 3.0.4 is installed on the server. What could be causing Capistrano to ignore the updated Ruby version and how can I resolve this issue?

1

There are 1 answers

0
Andres Perez On

Anyone with this problem and using RVM. Try rvm use --default NEW_VERSION

Maybe capistrano is using RVM default ruby version, so if you uninstalled or removed the previous version, just update the default with the new one.