We need to separate between environment variables that are being used when Capistrano are running its tasks (like deploying), and environment variables that Rails are using when running in production mode on the server.
If you need environment variables during a capistrano 3 session then I belive set :default_env
is the way to go. (Im still on capistrano 2 myself, so Im not 100% sure).
If you need production mode specific settings and environment variables you probably want something independent of Capistrano, like Figaro or rails_config
Why? Because there will likely be situations where Rails is being booted outside of capistrano. For instance, by a startup script running after a server reboot, a rails console session started on the server or a rake task running as a cron job on the server.