From 0905d96e89ef02bb39aba8454b76380f7176819e Mon Sep 17 00:00:00 2001 From: Prajakta Purohit Date: Thu, 19 Dec 2024 09:43:55 -0800 Subject: [PATCH] - Point GEM_HOME to the package/vendor directory. This will resolve to pkg/vendor/gems instead of package/vendor/gems/gems as done in the current hab install. - Create and add the /hab/kitchen directory to the GEM_PATH. With this change the GEM_PATHS will look like - GEM PATHS: - /hab/pkgs/core/ruby3_1/3.1.6/20241017135756/lib/ruby/gems/3.1.0 - /hab/pkgs/chef/chef-infra-client/19.0.60/20241216200649/vendor - /hab/kitchen Signed-off-by: Prajakta Purohit --- habitat/plan.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/habitat/plan.sh b/habitat/plan.sh index d74f0cc15..29239fb3a 100644 --- a/habitat/plan.sh +++ b/habitat/plan.sh @@ -36,7 +36,7 @@ do_unpack() { do_build() { echo $(pkg_path_for $_chef_client_ruby) - export GEM_HOME="$pkg_prefix/vendor/gems" + export GEM_HOME="$pkg_prefix/vendor" build_line "Setting GEM_PATH=$GEM_HOME" export GEM_PATH="$GEM_HOME" @@ -50,6 +50,7 @@ do_build() { } do_install() { + mkdir -p /hab/kitchen export GEM_HOME="$pkg_prefix/vendor/gems" build_line "Setting GEM_PATH=$GEM_HOME" @@ -58,7 +59,7 @@ do_install() { gem install chef-cli wrap_ruby_kitchen wrap_ruby_chef_cli - set_runtime_env "GEM_PATH" "${pkg_prefix}/vendor/gems" + set_runtime_env "GEM_PATH" "${pkg_prefix}/vendor/gems;/hab/kitchen" } wrap_ruby_kitchen() { @@ -95,4 +96,4 @@ EOF do_strip() { return 0 -} +} \ No newline at end of file