Closed jacquescrocker closed 10 years ago
same issue, but apparently worked fine on 0.3.3, I started getting this error on 0.3.4
Same issue here. Working fine with 0.3.3, failing after upgrading to 0.3.4. Maybe it's fixed again in 0.4.0, but it seems like that version hasn't been pushed to rubygems yet.
Cheers!
hmm, I am using Rails 3.2.17
and with latest rails_config 0.3.4
from RubyGems that works fine and I can access Settings
object from my environments/development.rb
. Are you sure that you installed initializers/rails_config.rb
and it does contain following lines?
RailsConfig.setup do |config|
config.const_name = 'Settings'
end
Does it need to be called rails_config.rb
? I have a file called _rails_config.rb
. I think I renamed it like that so it would be loaded the first one and I could use Settings
in the rest of the initializers.
I checked and from 0.3.4
the Settings
object is also available in application.rb
which was part of the 0.3.4
fix.
@deivid-rodriguez the file name does not really matter as far as I am aware. If it works for me with rails_config.rb
it should work for you too for _rails_config.rb
. However just to be safe, can you try to rename it?
No, it doesn't work in any case. This is a rails 4.1.0 app. Thanks for looking at this.
Then maybe the reason is Rails 4.1 which you have vs Rails 3.2 which I use. I will test it and get back to you later on today.
ok, thanks.
By the way, do you know about appraisal? It's pretty cool for this kind of things. :)
It works fine on 4.1.0 if you roll back to rails_config-0.3.3
Yep, it's a regression issue.
After some investigation, I found out that the issue appeared only in Rails 4.1 and was caused by commit 5cebb8d from @railsjedi. I reverted this change and now it seems to be working fine.
I followed @deivid-rodriguez tip and used appraisal gem to run complete test suite against 3 different versions of Rails: 3.2, 4.0 and 4.1 (bootstrapped by running rails g in respective version of rails gem). This should prevent similar errors in the future.
Your feedback and code review is welcome!
thanks, sorry about that! On Apr 17, 2014 5:03 PM, "Piotr Kuczynski" notifications@github.com wrote:
After some investigation, I found out that the issue appeared only in Rails 4.1 and was caused by commit 5cebb8dhttps://github.com/railsjedi/rails_config/commit/5cebb8dfrom @railsjedi https://github.com/railsjedi. I reverted this change and now it seems to be working fine.
I followed @deivid-rodriguez https://github.com/deivid-rodriguez tip and used appraisal gem to run complete test suite against 3 different versions of Rails: 3.2, 4.0 and 4.1 (bootstrapped by running rails g in respective version of rails gem). This should prevent similar errors in the future.
Your feedback and code review is welcome!
— Reply to this email directly or view it on GitHubhttps://github.com/railsjedi/rails_config/issues/72#issuecomment-40775983 .
Thanks, works fine now!
if you try to use Settings in environments/.rb, then it says "undefined constant Settings"