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: 7b1159d0a80014995b783d36a4d63c680a62f70d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/bin/collector b/bin/collector
index 4fec65e..e59eac7 100755
--- a/bin/collector
+++ b/bin/collector
@@ -3,8 +3,10 @@
 
 Process.setproctitle("discourse prometheus-collector")
 
+# We need the ABI version {MAJOR}.{MINOR}.0 here.
+abi_version = ENV['GEM_PATH'].split("/")[-1]
 version = File.read(File.expand_path("../../prometheus_exporter_version", __FILE__)).strip
-spec_file = File.expand_path("../../gems/#{RUBY_VERSION}/specifications/prometheus_exporter-#{version}.gemspec", __FILE__)
+spec_file = File.expand_path("../../gems/#{abi_version}/specifications/prometheus_exporter-#{version}.gemspec", __FILE__)
 
 spec = Gem::Specification.load spec_file
 spec.activate