Skip to main content
3 of 8
replaced http://stackoverflow.com/ with https://stackoverflow.com/
user avatar
user avatar

This might be helpful:

export $(cat .env | xargs) && rails c

Reason why I use this is if I want to test .env stuff in my rails console.

gabrielf came up with a good way to keep the variables local. This solves the potential problem when going from project to project.

env $(cat .env | xargs) rails

I've tested this with bash 3.2.51(1)-release

Silas Paul
  • 17.3k
  • 2
  • 15
  • 11