出于某种原因,我使用的 Rails 应用程序具有混合环境。例如,应用程序使用 config/environments/production.rb 并记录到 log/production.rb,但使用来自 config/database.yml 的开发设置,“rake about”显示开发模式:
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
服务器运行 Apache 和Passenger。
如何为 Rails 应用程序的所有部分打开生产模式?