How do I make a config yaml file reloadable in Rails 3?

+1 vote
asked Jan 30, 2016 by abg_The (2,130 points)
I'm in process of upgrading Rails app from 2 translation system has initializer defined in. Is there way I can make Rails rerun initializer when.

5 Answers

+1 vote
answered Feb 1, 2016 by Be_Hopeful (1,950 points)
selected Feb 2, 2016 by boykins
Best answer
Open the gitignore file and add the following line to the very end. If it exists the file will be loaded and the environment variables will be set. In addition to the answers posted here, make sure you read this article: Environment Variables in Ruby on Rails -
commented Feb 2, 2016 by boykins (1,080 points)
If for some reason the :key does not exist an KeyError exception will be raised
0 votes
answered Jan 31, 2016 by jvg5862 (1,570 points)
Storing env variables in config/application.
If you prefer, instead of keeping config/app. In production, use chef templates to generate config/app.

More about this you can find in source code #85 YAML Configuration (revised) - RailsCasts
+1 vote
answered Feb 27, 2016 by Practice (520 points)
Require global file in application.
0 votes
answered Mar 1, 2016 by cloutman_Cr (1,770 points)
Maybe this will help fellow developers
Here is his article about this
commented Mar 3, 2016 by Schrawder (290 points)
I had this same problem however none of the answers in this thread worked for me
0 votes
answered Mar 1, 2016 by gel_2185 (570 points)
See link below to get more details on this Making Configuration Files with YAML | Innovative Thought this helps
commented Mar 2, 2016 by since_loson (1,350 points)
Wouldn't the CONFIG hash solution work on Heroku also
commented Mar 2, 2016 by Bufford (290 points)
Subscribe to Watch EpisodeTweet
commented Mar 3, 2016 by thatZimmerle (860 points)
For more details see this answer

Related questions

What is Geekub?

Q&A site for professional and enthusiast programmers, software developers and other technical users. With your help, we hope to work together to build a library of detailed answers to just about any question that is related to programming!