From 006c8d164d16ced5b9b42f7ed155d417a3a7950d Mon Sep 17 00:00:00 2001 From: Niels Robin-Aubertin Date: Wed, 18 Oct 2023 21:30:29 -0400 Subject: [PATCH] Try to handle GEM_HOME issues --- discourse_rock/rockcraft.yaml | 13 ++++--------- src/charm.py | 3 ++- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/discourse_rock/rockcraft.yaml b/discourse_rock/rockcraft.yaml index 17a0bcb1..af0a1307 100644 --- a/discourse_rock/rockcraft.yaml +++ b/discourse_rock/rockcraft.yaml @@ -177,16 +177,11 @@ parts: override-build: | cd $CRAFT_STAGE/srv/discourse/app gem install -n "bin" bundler - bin/bundle install - bin/bundle install --gemfile="plugins/discourse-saml/Gemfile" - bin/bundle install --gemfile="plugins/discourse-prometheus/Gemfile" + GEM_HOME=/usr/lib/ruby/gems/2.7.0 bin/bundle install + GEM_HOME=/usr/lib/ruby/gems/2.7.0 bin/bundle install --gemfile="plugins/discourse-prometheus/Gemfile" + GEM_HOME=/usr/lib/ruby/gems/2.7.0 bin/bundle install --gemfile="plugins/discourse-saml/Gemfile" organize: - '/var/lib/gems': var/lib/gems - 'srv/discourse/plugins/discourse-saml/Gemfile.lock': srv/discourse/app/plugins/discourse-saml/ - 'srv/discourse/plugins/discourse-prometheus/Gemfile.lock': srv/discourse/app/plugins/discourse-prometheus/ - 'srv/discourse/plugins/discourse-mermaid/Gemfile.lock': srv/discourse/app/plugins/discourse-mermaid/ - 'srv/discourse/plugins/discourse-markdown-note/Gemfile.lock': srv/discourse/app/plugins/discourse-markdown-note/ - 'srv/discourse/plugins/discourse-solved/Gemfile.lock': srv/discourse/app/plugins/discourse-solved/ + '/usr/lib/ruby/gems/2.7.0': usr/lib/ruby/gems/2.7.0 'srv/discourse/app/bin/*': srv/discourse/app/bin/ 'srv/discourse/app/Rakefile': srv/discourse/app/ 'srv/discourse/app/bundle': srv/discourse/app/ diff --git a/src/charm.py b/src/charm.py index c4c62631..d1ffcccd 100755 --- a/src/charm.py +++ b/src/charm.py @@ -353,7 +353,8 @@ def _create_discourse_environment_settings(self) -> typing.Dict[str, str]: "DISCOURSE_SMTP_PASSWORD": self.config["smtp_password"], "DISCOURSE_SMTP_PORT": str(self.config["smtp_port"]), "DISCOURSE_SMTP_USER_NAME": self.config["smtp_username"], - "GEM_HOME": "/var/lib/gems/2.7.0", + "GEM_HOME": "/usr/lib/ruby/gems/2.7.0", + "GEM_PATH": "/usr/lib/ruby/gems/2.7.0", "RAILS_ENV": "production", } pod_config.update(self._get_saml_config())