Check out example codes for "ruby on rails set environment variables example". It will help you in understanding the concepts better.

Code Example 1

config.before_configuration do  env_file = File.join(Rails.root, 'config', 'local_env.yml')  YAML.load(File.open(env_file)).each do |key, value|    ENV[key.to_s] = value  end if File.exists?(env_file)end

Code Example 2

MAIL_USERNAME: 'Your_Username' MAIL_PASSWORD: 'Your_Username'

Learn ReactJs, React Native from akashmittal.com