I’m seeing the same thing. It happens in tests. Also happens on 1.2.1.
Works fine in RC2 and 1.1.6.
This seems to be related to referring to the class in question from
environment.rb . Commenting out the sections of custom code in
environment.rb solves the problem, but now parts of the rest of the app
don’t work anymore since certain things weren’t setup right in
environment.rb. Any suggestions would be appreciated.
I see a different error when trying to start the server, but commenting
out the same lines in environment.rb fixes that too.
We’ve fixed a bug that allowed libraries from Ruby’s standard library to
be auto-loaded on reference. Before, if you merely reference the
Pathname constant, we’d autoload pathname.rb. No more, you’ll need to
manually require ‘pathname’ now.
We’ve also improved the handling of module loading, which means that a
reference for Accounting::Subscription will look for
app/models/accounting/subscription.rb. At the same time, that means that
merely referencing Subscription will not look for subscription.rb in any
subdir of app/models. Only app/models/subscription.rb will be tried. If
you for some reason depended on this, you can still get it back by
adding app/models/accounting to config.load_paths in
config/environment.rb.
[/blockquote]
This is a long shot, installed 1.2.1, but in my app that matters, server
won’t start (will start with other apps):
** Starting Rails with development environment …
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:377:in new_constants_in': You have a nil object when you didn't expect it! (NoMethodError) You might have expected an instance of Array. The error occurred while evaluating nil.empty? from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:203:inload_file’
from
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:95:in require_or_load' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:61:independ_on’
from
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:443:in require_dependency' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.1/lib/action_controller/helpers.rb:67:inhelper’
from
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.1/lib/action_controller/helpers.rb:58:in helper' from C:/InstantRails/rails_apps/pazap/config/../vendor/plugins/debug-view-helper/lib/view_debug_helper.rb:94 from C:/InstantRails/rails_apps/pazap/config/../vendor/plugins/debug-view-helper/lib/view_debug_helper.rb:93 ... 20 levels... from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel/command.rb:199:inrun’
from
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/bin/mongrel_rails:235
from C:\InstantRails\ruby\bin\mongrel_rails:18
from -e:3
is it perhaps running into a plugin it doesn’t like? Anyone else having
this error?
These errors did NOT occur in the release candidate #2.
`load_missing_constant’: Expected
/Users/baldwina/svn/xxxx/trunk/config/…/lib/customer.rb
to define Customer (LoadError)
I was having this error with the railsdav plugin. I was able to fix it
by adding a line that says require “railsdav” to the
vendor/plugins/railsdav/init.rb
I’ve noticed that my problem with loading models is only in the
development environment. Specifically, if I turn on the caching of
loaded classes in config/environments/development.rb
(config.cache_classes = true) my problem goes away. (Not really since
it I want to not cache the classes in dev.)
Is your problem occuring regardless of the cache setting? Or does the
cache setting impact what occurs?
per Alan’s reply, I added a few strategic requires and that seems to
have greatly improved the situation. Server starts now, but now there
are other errors indicating I still have more to do. Thanks all for the
assistance. I think I can take it from here.
As posted to this list a while back, I’m currently soliciting feedback
on the upcoming 1.2 release of the engines plugin, which is compatible
with Rails 1.2. The “official” release (the one you get at the moment
when running script/plugin install engines) is NOT compatible.
You can find the current 1.2 release branch at http://svn.rails- engines.org/engines/branches/rb_1.2 - checkout this code into vendor/
plugins for a 1.2-compatible version of the engines plugin.
You should also be aware that until the “datebocks” plugin is updated
to be compatible with the engines 1.2 release, it will (probably) not
work properly.
Same problem here. It’s definitely plug-in related, and it’s one of
these (I only had the following plugins included):
default_value
enum-column
engines (required by datebocks_engine)
datebocks_engine
I’m still trying to nail this down, but I’m guessing it’s engines based
on how much munging it must do.
I’ve seen the same thing. What solved it for me was to change the
directory names with dashes (-) in them, to use underscored (_) instead.
So enum_column instead of enum-column.