uninitialized constant Authorization when using Passenger

320 views
Skip to first unread message

Sean Hussey

unread,
Oct 14, 2010, 3:03:12 PM10/14/10
to declarative_authorization
Hello,

I'm getting a "uninitialized constant Authorization" error when trying
to run DA from within Passenger. It's been fine within Passenger for
a while, but I did recently add Bundler to our Rails 2.3.9 app.
That's when it seems to have started happening.

If I run script/server, everything is fine.

I've tried this with DA 0.4.1 and 0.5.1, but neither makes a
difference. The gem is installed fine:

$ gem list declarative_authorization

*** LOCAL GEMS ***

declarative_authorization (0.5.1, 0.4)
$ bundle show declarative_authorization
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/
declarative_authorization-0.5.1

The environment seems to be loading the gem fine, as it's in the
backtrace. Any ideas?

Backtrace:
# File Line Location
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/activesupport-2.3.9/
lib/active_support/dependencies.rb 469 in `load_missing_constant'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/activesupport-2.3.9/
lib/active_support/dependencies.rb 106 in `const_missing'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/activesupport-2.3.9/
lib/active_support/dependencies.rb 118 in `const_missing'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/
declarative_authorization-0.5.1/config/routes.rb 5
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/actionpack-2.3.9/lib/
action_controller/routing/route_set.rb 227 in `draw'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/
declarative_authorization-0.5.1/config/routes.rb 4
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/activesupport-2.3.9/
lib/active_support/dependencies.rb 171 in
`load_without_new_constant_marking'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/activesupport-2.3.9/
lib/active_support/dependencies.rb 171 in `load'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/activesupport-2.3.9/
lib/active_support/dependencies.rb 547 in `new_constants_in'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/activesupport-2.3.9/
lib/active_support/dependencies.rb 171 in `load'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/actionpack-2.3.9/lib/
action_controller/routing/route_set.rb 287 in `load_routes!'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/actionpack-2.3.9/lib/
action_controller/routing/route_set.rb 287 in `each'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/actionpack-2.3.9/lib/
action_controller/routing/route_set.rb 287 in `load_routes!'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/actionpack-2.3.9/lib/
action_controller/routing/route_set.rb 267 in `reload!'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/rails-2.3.9/lib/
initializer.rb 537 in `initialize_routing'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/rails-2.3.9/lib/
initializer.rb 188 in `process'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/rails-2.3.9/lib/
initializer.rb 113 in `send'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@lisa/gems/rails-2.3.9/lib/
initializer.rb 113 in `run'
/Users/sean/DMC/lisa/config/environment.rb 9
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/railz/application_spawner.rb 318 in `require'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/railz/application_spawner.rb 318 in
`preload_application'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/railz/application_spawner.rb 267 in
`initialize_server'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/utils.rb 323 in `report_app_init_status'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/railz/application_spawner.rb 246 in
`initialize_server'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/abstract_server.rb 194 in `start_synchronously'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/abstract_server.rb 163 in `start'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/railz/application_spawner.rb 222 in `start'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/spawn_manager.rb 253 in
`spawn_rails_application'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/abstract_server_collection.rb 126 in
`lookup_or_add'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/spawn_manager.rb 247 in
`spawn_rails_application'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/abstract_server_collection.rb 80 in
`synchronize'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/abstract_server_collection.rb 79 in
`synchronize'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/spawn_manager.rb 246 in
`spawn_rails_application'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/spawn_manager.rb 145 in `spawn_application'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/spawn_manager.rb 278 in
`handle_spawn_application'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/abstract_server.rb 352 in `__send__'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/abstract_server.rb 352 in `main_loop'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
lib/phusion_passenger/abstract_server.rb 196 in `start_synchronously'
/Users/sean/.rvm/gems/ree-1.8.7-2010.02@global/gems/passenger-2.2.15/
bin/passenger-spawn-server 61

byrnejb

unread,
Oct 19, 2010, 9:51:08 AM10/19/10
to declarative_authorization


On Oct 14, 3:03 pm, Sean Hussey <seanhus...@gmail.com> wrote:
> Hello,
>
> I'm getting a "uninitialized constant Authorization" error when trying
> to run DA from within Passenger.  It's been fine within Passenger for
> a while, but I did recently add Bundler to our Rails 2.3.9 app.
> That's when it seems to have started happening.

I cannot find the name of the missing constant anywhere in your trace.
It would not happen to be UserSessionController would it?

byrnejb

unread,
Oct 19, 2010, 9:53:56 AM10/19/10
to declarative_authorization


On Oct 19, 9:51 am, byrnejb <byrn...@harte-lyne.ca> wrote:
> On Oct 14, 3:03 pm, Sean Hussey <seanhus...@gmail.com> wrote:
>
> > Hello,
>
> > I'm getting a "uninitialized constant Authorization" error
>
> I cannot find the name of the missing constant anywhere in your trace.
> It would not happen to be UserSessionController would it?

Because it was too obvious to overlook. Sigh. Do you have a resource
authorization in your routes file? if so, what does it look like?

Steffen Bartsch

unread,
Oct 20, 2010, 2:54:04 AM10/20/10
to declarative_...@googlegroups.com
Am Donnerstag, 14. Oktober 2010 schrieb Sean Hussey:
> I've tried this with DA 0.4.1 and 0.5.1, but neither makes a
> difference. The gem is installed fine:

Are you sure that your Gemfile is setup correctly? To have the gem available
in the app, it needs to be in the bundle in Rails 3.

Steffen

Sean Hussey

unread,
Oct 20, 2010, 9:20:03 AM10/20/10
to declarative_...@googlegroups.com
Ugh, it was similar to that. It's a Rails 2.3 project and I didn't have the bundler init set up correctly.

Sorry for the bother. Thanks for the help!

Sean

> --
> You received this message because you are subscribed to the Google Groups "declarative_authorization" group.
> To post to this group, send email to declarative_...@googlegroups.com.
> To unsubscribe from this group, send email to declarative_author...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/declarative_authorization?hl=en.
>

Mohamed Shaamil

unread,
Jan 29, 2013, 4:00:48 AM1/29/13
to declarative_...@googlegroups.com, seanh...@gmail.com
Hello Sean Hussey

I am having the same problem..How did you resolve this problem... I would be glad if you could let me know....

Reply all
Reply to author
Forward
0 new messages