Skip to main content

22 posts tagged with "Ruby"

Ruby Programming Language and RubyGems

View All Tags

How to Read an Environment Variable in Ruby

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

Settings that change between computers, such as a database address or an API key, belong in environment variables. Ruby reads them from ENV, and ENV.fetch('NAME', default) gives you the value, or the default when the variable isn't set.