From 11163f6b6ad47ad32fa7d7022d522560049164dc Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Thu, 7 Nov 2024 18:57:57 +0900 Subject: [PATCH] msi: set GEM_HOME / GEM_PATH in batch file Signed-off-by: Shizuo Fujita --- fluent-package/msi/assets/fluentd.bat | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fluent-package/msi/assets/fluentd.bat b/fluent-package/msi/assets/fluentd.bat index bc2687c16..552923cd2 100644 --- a/fluent-package/msi/assets/fluentd.bat +++ b/fluent-package/msi/assets/fluentd.bat @@ -10,8 +10,12 @@ if "%~nx0" == "td-agent.bat" ( @rem Convert path separator from backslash to forwardslash set FLUENT_PACKAGE_TOPDIR=%FLUENT_PACKAGE_TOPDIR:\=/% -set PATH=%FLUENT_PACKAGE_TOPDIR%bin;%PATH% +set "FLUENT_PACKAGE_BINDIR=%FLUENT_PACKAGE_TOPDIR%bin" +set PATH=%FLUENT_PACKAGE_BINDIR%;%PATH% set PATH=%FLUENT_PACKAGE_TOPDIR%;%PATH% +for /f "usebackq" %%i in (`^""%FLUENT_PACKAGE_BINDIR%\ruby.exe" -rrbconfig -e "print RbConfig::CONFIG['ruby_version']"^"`) do set RUBY_VERSION=%%i +set "GEM_HOME=%FLUENT_PACKAGE_TOPDIR%lib/ruby/gems/%RUBY_VERSION%" +set "GEM_PATH=%FLUENT_PACKAGE_TOPDIR%lib/ruby/gems/%RUBY_VERSION%" set "FLUENT_CONF=%FLUENT_PACKAGE_TOPDIR%etc/fluent/fluentd.conf" set "FLUENT_PLUGIN=%FLUENT_PACKAGE_TOPDIR%etc/fluent/plugin"