For some reason the Rails application I work with has a mixed environment. For example the application uses config/environments/production.rb and is logging to log/production.rb, but uses development settings from config/database.yml and "rake about" shows development mode:
About your application's environment
Rails version 4.2.7.1
Ruby version 2.1.9-p495 (x86_64-linux-gnu)
RubyGems version 2.4.5.4
Rack version 1.6.5
JavaScript Runtime Node.js (V8)
Middleware Rack::Sendfile, ActionDispatch::Static, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x0000000633e5b8>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::Migration::CheckPending, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, Rack::Head, Rack::ConditionalGet, Rack::ETag, Warden::Manager, HttpAcceptLanguage::Middleware, OmniAuth::Strategies::GoogleOauth2
Application root /var/www/[#########]
Environment development
Database adapter mysql2
Database schema version 20191114203932
Server runs Apache and Passenger.
How can I turn on production mode for all parts of Rails application?