Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #761 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

[PATCH] RAILS_ROOT may not be defined when AP loaded, don't set ROUTE_FILE on load

Reported by: Scott <scott@elitists.net> Assigned to: David
Priority: high Milestone:
Component: ActionPack Version: 0.10.0
Severity: normal Keywords:
Cc:

Description (Last modified by david)

This happens when packaging an application as a gem. Rubygems produces a start up script that essentially does this:

require 'rubygems'
require_gem 'YourApp' # At this point AP gets loaded
load 'yourscript' # But environment.rb is not processed until here

So ROUTE_FILE gets set to nil and routes will not be found.

Since ROUTE_FILE is only used in RouteSet#reload, setting its value should be delayed until then to ensure that RAILS_ROOT is valid.

Attachments

routing.rb.diff (1.0 kB) - added by Scott <scott@elitists.net> on 03/01/05 20:48:11.
Patch for #761

Change History

03/01/05 20:48:11 changed by Scott <scott@elitists.net>

  • attachment routing.rb.diff added.

Patch for #761

03/02/05 00:03:14 changed by david

  • status changed from new to closed.
  • resolution set to fixed.
  • description changed.