Nevermind, got this problem figured out. Not Heroku specific at all. Turned out the issue was created by new reference to the constants in the models. On production servers, apparently Rails loads all models before environment.rb has been completely read, resulting in undefined constants when it hits them. Solved it by just moving the constants closer to the top of environment.rb.
On Mar 7, 11:37 pm, Mike <[email protected]> wrote: > I have an application that relies on environment.rb constants > throughout. Everything was working fine with my preexisting constants > until I added a new one and some references to both it and the pre- > existing ones today. Then I started getting these errors: > > ** [NewRelic] New Relic RPM Agent 2.10.5 Initialized: pid = 21937 > ** [NewRelic] Agent Log found in /disk1/home/slugs/130925_544cea4_41fc/ > mnt/log/newrelic_agent.log > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ > active_support/dependencies.rb:105:in `const_missing': uninitialized > constant Announcement::QUICK_TEXT_MAX_LENGTH (NameError) > from /disk1/home/slugs/130925_544cea4_41fc/mnt/app/models/ > announcement.rb:15 > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 31:in `gem_original_require' > from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 31:in `require' > from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ > active_support/dependencies.rb:158:in `require' > from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ > active_support/dependencies.rb:265:in `require_or_load' > from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ > active_support/dependencies.rb:224:in `depend_on' > from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ > active_support/dependencies.rb:136:in `require_dependency' > from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb: > 414:in `load_application_classes' > ... 23 levels... > from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb: > 29:in `instance_eval' > from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb: > 29:in `initialize' > from /home/heroku_rack/heroku.ru:1:in `new' > from /home/heroku_rack/heroku.ru:1 > > Even maintenance mode dies with this error, as does the console. > Oddly enough, the constant is defined clear as day in environment.rb, > and works perfectly on my local development machine. I have double > checked my development.rb and production.rb and do not see anything in > those that would be causing this. Does anyone have any idea on what > the problem could be? -- You received this message because you are subscribed to the Google Groups "Heroku" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/heroku?hl=en.
