about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/web-apps/discourse/plugins/discourse-prometheus/spec-import-fix-abi-version.patch
blob: de3a5c718f00355ebb9ce1a1a935484a1377d906 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/bin/collector b/bin/collector
index 6bd04a8caffb..119526fc6ea3 100644
--- a/bin/collector
+++ b/bin/collector
@@ -3,12 +3,14 @@
 
 Process.setproctitle("discourse prometheus-collector")
 
+# We need the ABI version {MAJOR}.{MINOR}.0 here.
+abi_version = ENV['GEM_PATH'].split("/")[-1]
 [
   "webrick-#{ENV["WEBRICK_VERSION"]}",
   "prometheus_exporter-#{ENV["PROMETHEUS_EXPORTER_VERSION"]}",
 ].each do |spec_name|
   spec_file =
-    File.expand_path("../../gems/#{RUBY_VERSION}/specifications/#{spec_name}.gemspec", __FILE__)
+    File.expand_path("../../gems/#{abi_version}/specifications/#{spec_name}.gemspec", __FILE__)
   spec = Gem::Specification.load(spec_file)
   spec.activate
 end