Browse Source

Only error out if Rails.env differs from options.environment

MSP-10964
Luke Imhoff 5 years ago
parent
commit
f9ab7f7a88
No account linked to committer's email address
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      lib/metasploit/framework/parsed_options/base.rb

+ 1
- 1
lib/metasploit/framework/parsed_options/base.rb View File

@@ -57,7 +57,7 @@ class Metasploit::Framework::ParsedOptions::Base
57 57
   #
58 58
   # @return [void]
59 59
   def environment!
60
-    if defined?(Rails) && Rails.instance_variable_defined?(:@_env)
60
+    if defined?(Rails) && Rails.instance_variable_defined?(:@_env) && Rails.env != options.environment
61 61
       raise "#{self.class}##{__method__} called too late to set RAILS_ENV: Rails.env already memoized"
62 62
     end
63 63
 

Loading…
Cancel
Save