This project is archived and is in readonly mode.

#303 ✓resolved
Jesper Hvirring Henriksen

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

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>

People watching this ticket

Attachments

Pages