我正在Ubuntu 14.4、Ruby 2.3.3、Nginx和Passenger 中部署我的应用程序。当我使用 部署时capistrano,出现错误:
SSHKit::Command::Failed: passenger-config exit status: 1
passenger-config stdout: Nothing written
passenger-config stderr: *** ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it
is running, then the causes of this problem could be one of:
1. You customized the instance registry directory using Apache's
PassengerInstanceRegistryDir option, Nginx's
passenger_instance_registry_dir option, or Phusion Passenger Standalone's
--instance-registry-dir command line argument. If so, please set the …Run Code Online (Sandbox Code Playgroud) 我如何获取从给予日期算起过去 x 个月的信息?
例如,如果日期是2023-01-04,并且我想要过去 3 个月(包括当前日期),它会给我一个array:
[
'2023-01-01',
'2022-12-01',
'2022-11-01'
]
Run Code Online (Sandbox Code Playgroud)
我尝试过:
current_month = Date.today.month
3.downto(1).map { |n| Date.parse(DateTime::MONTHNAMES.drop(1)[(current_month - n) % 12]).strftime('%Y-%m-%d') }
Run Code Online (Sandbox Code Playgroud)
当一年还没有结束时,它工作得很好,它只给出当年的月份,而对于新的一年,它输出完全错误的日期。
PS:我见过一些解决方案,但没有任何效果