In my app I'm using configatron gem. The problem is I dont't understand clearly where I should store configatron settings. I put configatron.application_url = 'http://google.com/'
in config/configatron/defaults.rb but this is not working. In the view configatron.application_url
displays #<Configatron::Store:0x000001035afe70>
Asked
Active
Viewed 573 times
0
-
did you restart your server? – apneadiving Feb 10 '14 at 10:54
-
show you env with `configatron.to_h` – Малъ Скрылевъ Feb 10 '14 at 11:01
2 Answers
1
Looks like you've missed installation step. Run the following code in shell (from rails app directory):
rails generate configatron:install
It will generate appropriate initializer (and this initializer should load your configatron file).
For more details on Rails and configatron, feel free to consult Rails section on configatron GitHub page.

marvelousNinja
- 1,510
- 9
- 15
-
Try to set and log `configatron.application_url` inside of your initializer (not `default.rb`). Let's see if it works that way. – marvelousNinja Feb 10 '14 at 11:17
-
What do you mean by it's not working? Server fails to load? Or you don't see value in the console? – marvelousNinja Feb 10 '14 at 11:25
-
-
-
Better variant - use `rails c` and play with it there. You know how to use rails console? – marvelousNinja Feb 10 '14 at 11:30
-
it's strange, but in rails console configatron.application_url displays correct – Pavel Feb 10 '14 at 11:39
-
Is it possible that you running your console and application in a different environments? – marvelousNinja Feb 10 '14 at 11:53
-
-
What kind of server (WEBrick, Unicorn or something else) you use? – marvelousNinja Feb 10 '14 at 12:09
0
I understood what the problem is. On the on the github page of Configatron developers suggest to install version 3.0.0.rc1. I downgraded Configatron to version 2.9.1 and everything worked. Thanks to all participants!

Pavel
- 1,934
- 3
- 30
- 49