我已经苦苦挣扎了好几天,试图使用mina
将更新部署到我的Rails 5.2应用程序中。我正在尝试为生产数据库创建自动备份,并且目前正在使用以下方法进行操作:
mina 1.2.3
,whenever 0.10.0
和mina-whenever 1.0.1
。
运行mina deploy
时收到错误消息:
-----> Update crontab for <my_server_ip>_production
bash: line 156: bundle: command not found
! ERROR: Deploy failed.`
经过一番阅读,我最终发现mina-whenever
的当前发行版中存在一个未解决的问题,与我正在遇到的问题-Open issue on GitHub
我注意到有一个来自贡献者的建议解决方法,可以通过向我的gem 'mina-whenever', git: 'https://github.com/Val/mina-whenever.git', branch: :add_environment_variable_support, require: false
添加Gemfile
来访问
这看起来很有希望,但是使用downcase
函数会引发一个全新的错误:
** 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)>'
here提供了建议的解决方法中对mina-whenever
代码的更新,引起问题的特定行是:
set :whenever_environment, -> { fetch(fetch(:environment_variable).downcase.to_sym) }
请您提出我可能如何解决此问题的方法,除了用力指望发行新版本并且没有相同问题的方法之外。我是Rails的新手,所以请原谅我的无知...