---
title: "Discussion on \"Lessons learned from failing to access an environment variable in YMAL file\" | Hashnode"
description: "Discussion on \"Lessons learned from failing to access an environment variable in YMAL file\". Note: The following was tested with Ruby 2.6.6 / Rails 5.2.6.\nSituation\nI tried to add an environment variable in the application.yml file.\n# config/application.yml\n\ndefault:\n  #...\n  API_TOKEN: ABC123456\n\nAnd I expected when executing ENV['API_TOKEN..."
url: "https://hashnode.com/posts/lessons-learned-from-failing-to-access-an-environment-variable-in-ymal-file/65c47d39b9031cc7255031f2"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Lessons learned from failing to access an environment variable in YMAL file](https://lynnbright.com/lessons-learned-from-failing-to-access-an-environment-variable-in-ymal-file?utm_source=hashnode&utm_medium=feed)

Note: The following was tested with Ruby 2.6.6 / Rails 5.2.6. Situation I tried to add an environment variable in the application.yml file. # config/application.yml default: #... API\_TOKEN: ABC123456 And I expected when executing ENV\['API\_TOKEN...

Sep 9, 2021 · 3 min read · lynnbright.com  
Read the article

-   [#ruby-on-rails](https://hashnode.com/tag/ruby-on-rails)

## Written by

[Lynn Chang](https://hashnode.com/@Lynnbright)

@Lynnbright · Taipei, Taiwan

  
[View profile](https://hashnode.com/@Lynnbright)

Rails Developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
