This project is archived and is in readonly mode.
config/initializers/new_rails_defaults.rb should check for disabled frameworks
Reported by Jesper Hvirring Henriksen | June 2nd, 2008 @ 10:10 PM
In 2.1.0, if ActiveRecord is disabled in config/environment.rb using e.g.
config.frameworks -= [ :active_record ]
script/server fails to launch:
[test_new_rails_features]$ script/server
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails 2.1.0 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
Exiting
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:278:in `load_missing_constant': uninitialized constant ActiveRecord (NameError)
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:467:in `const_missing'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:479:in `const_missing'
from /Users/jesper/Projects/rails/test_new_rails_features/config/initializers/new_rails_defaults.rb:5
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load'
from /Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/initializer.rb:475:in `load_application_initializers'
... 32 levels...
from /Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
from script/server:3
The culprit is config/initializers/new_rails_defaults.rb, which should test to see if ActiveRecord is loaded.
Will create and submit a patch ASAP...
Comments and changes to this ticket
-
Jesper Hvirring Henriksen June 2nd, 2008 @ 10:23 PM
- Title changed from configs/initializers/new_rails_defaults.rb should check for disabled frameworks to config/initializers/new_rails_defaults.rb should check for disabled frameworks
The attached patch wraps calls to ActiveRecord::Base and ActiveSupport in "if defined?" blocks.
-
Repository June 3rd, 2008 @ 12:43 AM
- State changed from new to resolved
(from [4b4aa8f6e08ba2aa2ddce56f1d5b631a78eeef6c]) AR can be disabled, new_rails_defaults.rb should check [#303 state:resolved] (Jesper Hvirring Henriksen)
-
Repository June 3rd, 2008 @ 01:01 AM
(from [3d5bf096e85deb3d3da15c760598a7db5f381b3c]) AR can be disabled, new_rails_defaults.rb should check [#303 state:resolved] (Jesper Hvirring Henriksen)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>