I have been struggling for a number of days, trying to deploy an update to my Rails 5.2 application using mina
. I am trying to create an automated backup of my production database and am currently doing this using:
mina 1.2.3
, whenever 0.10.0
and mina-whenever 1.0.1
.
When I run mina deploy
I get the error message:
-----> Update crontab for <my_server_ip>_production
bash: line 156: bundle: command not found
! ERROR: Deploy failed.`
Having read around a bit, I eventually discovered that there is an open issue on the current release of mina-whenever
, matching exactly what I am experiencing - Open issue on GitHub
I noticed there is a proposed workaround from a contributor which is accessible by adding gem 'mina-whenever', git: 'https://github.com/Val/mina-whenever.git', branch: :add_environment_variable_support, require: false
to my Gemfile
This looked promising, but raises a completely new error with the downcase
function:
** Execute whenever:update
mina aborted!
NoMethodError: undefined method `downcase' for nil:NilClass
/Users/<my_username>/.rvm/gems/ruby-2.4.2/bundler/gems/mina-whenever-78af0a48bc16/lib/mina/whenever/tasks.rb:2:in `block in <top (required)>'
The updates to the mina-whenever
code in the suggested workaround are provided here, with the specific line causing the problem being:
set :whenever_environment, -> { fetch(fetch(:environment_variable).downcase.to_sym) }
Please could you suggest how I may be able to resolve this issue, other than crossing my fingers in the hope that a new release is issued and it doesn't have the same problem. I am relatively new to Rails, so please forgive my ignorance...