PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, August 21, 2022

[FIXED] How to manually set ENV variables when running rails console

 August 21, 2022     console, environment-variables, ruby, ruby-on-rails     No comments   

Issue

Is there a way to pass in env variables when running rails console? I have a rails app running on a server and when I try to ssh in and run rails console for debugging it says it is missing the master key to decrypt the credentials. But the master key is set in the env variables as RAILS_MASTER_KEY and is definitely correct and working because the app is working normally and able to access the credentials.

Is there a way to run something like:

RAILS_MASTER_KEY=<master_key> rails console


Solution

From your console.

env RAILS_MASTER_KEY="..." rails c

See more here https://www.honeybadger.io/blog/ruby-guide-environment-variables/



Answered By - Eyeslandic
Answer Checked By - Marie Seifert (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing