diff --git a/lib/metasploit/framework/require.rb b/lib/metasploit/framework/require.rb index c493c834e6..760771c488 100644 --- a/lib/metasploit/framework/require.rb +++ b/lib/metasploit/framework/require.rb @@ -49,10 +49,14 @@ module Metasploit # # @return [void] def self.optionally_active_record_railtie - optionally( + if ::File.exist?(Rails.application.config.paths['config/database'].first) + optionally( 'active_record/railtie', 'activerecord not in the bundle, so database support will be disabled.' - ) + ) + else + warn 'Could not find database.yml, so database support will be disabled.' + end end # Tries to `require 'metasploit/credential/creation'` and include it in the `including_module`. @@ -89,4 +93,4 @@ module Metasploit end end end -end \ No newline at end of file +end