Complete the code to load environment variables from the .env file using dotenv gem.
require 'dotenv'\nDotenv.[1]
The Dotenv.load method loads environment variables from the .env file into the application environment.
Complete the code to access the Rails environment configuration for the current environment.
Rails.application.config_for(:[1])The config_for(:environment) method loads configuration specific to the current Rails environment (like development, test, or production).
Fix the error in the code to correctly fetch a configuration value from credentials.
Rails.application.credentials.[1]Accessing credentials uses method calls like Rails.application.credentials.api_key without fetch or get methods.
Fill both blanks to define a custom configuration in config/application.rb and access it in the app.
module MyApp\n class Application < Rails::Application\n config.[1] = 'value'\n end\nend\n\nRails.application.config.[2]
You define a custom config key like config.custom_setting and access it the same way with Rails.application.config.custom_setting.
Fill all three blanks to create a YAML environment config file and load a value in Rails.
development:\n api_key: [1]\n\nconfig = Rails.application.config_for(:[2])\nputs config[:[3]]
The YAML file defines api_key: '123abc' under development. Then config_for(:environment) loads it, and config[:api_key] accesses the key.