Skip to content

Commit

Permalink
Fixing diagnose when Rails is not present
Browse files Browse the repository at this point in the history
@TheMuppet found this issue when is trying to load the appsignal, The
gem is loading rails and also verifying the application.rb path. Some
applications has that configuration already but that not means that they
are Rails already.

He proposed to fix this verifying if Rails is defined or not, with this
fix he solved the load issue.
  • Loading branch information
asccigcc committed Feb 22, 2021
1 parent bd44970 commit 14c8efa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions lib/appsignal/cli/diagnose.rb
Original file line number Diff line number Diff line change
Expand Up @@ -583,11 +583,7 @@ def print_empty_line
end

def rails_app?
require "rails"
require File.expand_path(File.join(Dir.pwd, "config", "application.rb"))
true
rescue LoadError
false
defined?(Rails)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/appsignal/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Appsignal
VERSION = "2.11.8".freeze
VERSION = "2.11.9".freeze
end

0 comments on commit 14c8efa

Please sign in to comment.