# Weird Extension stuff on Deployment

**URL:** <https://www.ruby-forum.com/t/weird-extension-stuff-on-deployment/85874>\
**Category:** Radiant CMS\
**Created:** [February 17, 2007, 1:50am UTC](https://www.ruby-forum.com/t/weird-extension-stuff-on-deployment/85874 "2007-02-17T01:50:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluetrust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8e7dd6/32.png) [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Post date:** [February 17, 2007, 1:50am UTC](https://www.ruby-forum.com/t/weird-extension-stuff-on-deployment/85874/1 "2007-02-17T01:50:34Z")

</div>

I developed a Radiant app with extensions, works great on my local box.

I deployed to TextDrive and now I’m having an issue.

- Login fine
- admin/pages shows fine
- First time hitting my extensions link the page renders fine
- Second time hitting my extensions like BAM!  
Application error

This is the stack trace:

NameError (uninitialized constant Admin::EventsController):  
/vendor/rails/activerecord/lib/…/…/activesupport/lib/active\_support/dependencies.rb:266:in  
`load_missing_constant' /vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:452:in`const\_missing’  
/vendor/rails/activerecord/lib/…/…/activesupport/lib/active\_support/inflector.rb:250:in  
`constantize' /vendor/rails/activerecord/lib/../../activesupport/lib/active_support/core_ext/string/inflections.rb:148:in`constantize’  
/vendor/rails/actionpack/lib/action\_controller/routing.rb:1284:in  
`recognize' /vendor/rails/railties/lib/dispatcher.rb:40:in`dispatch’  
/vendor/rails/railties/lib/fcgi\_handler.rb:168:in `process_request' /vendor/rails/railties/lib/fcgi_handler.rb:143:in`process\_each\_request!’  
/vendor/rails/railties/lib/fcgi\_handler.rb:109:in  
`with_signal_handler' /vendor/rails/railties/lib/fcgi_handler.rb:142:in`process\_each\_request!’  
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:600:in  
`each_cgi' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:597:in`each\_cgi’  
/vendor/rails/railties/lib/fcgi\_handler.rb:141:in  
`process_each_request!' /vendor/rails/railties/lib/fcgi_handler.rb:55:in`process!’  
/vendor/rails/railties/lib/fcgi\_handler.rb:25:in `process!’  
/users/home/michaelj/domains/dev.codeinmotion.com/web/current/public/dispatch.fcgi:24

So the first time it loads my extension fine but the second time it  
can’t find it?

I do have rails in vendor/rails.

Suggestions?

Thanks-  
Michael

---

<div class="post-metadata">

**Author:** ![bluetrust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8e7dd6/32.png) [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Post date:** [February 17, 2007, 4:57am UTC](https://www.ruby-forum.com/t/weird-extension-stuff-on-deployment/85874/2 "2007-02-17T04:57:16Z")

</div>

First, make sure that your App is in production mode in environment.rb.

If that doesn’t solve everything, then you can force things to work with  
explicit “load” calls:

i.e.

load  
“#{RADIANT\_ROOT}/vendor/extensions/page\_attributes/app/models/page.rb”

Try putting an explicit load call to your events controller at the end  
of your extension definition. (or at the end of some other controller in  
radiant core).

Yes I know this is a hack, but it’s quick and dirty…

---

<div class="post-metadata">

**Author:** ![bluetrust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8e7dd6/32.png) [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Post date:** [February 18, 2007, 11:48pm UTC](https://www.ruby-forum.com/t/weird-extension-stuff-on-deployment/85874/3 "2007-02-18T23:48:24Z")

</div>

Thanks for the suggestions Jacob.

The way I solved this was by editing my xxx\_extension.rb file in the  
routes section:

old: map.connect ‘admin/tools/:action’, :controller =\> ‘admin/tools’  
new: map.connect ‘admin/tools/:action’, :controller =\> ‘tools’

Weird, works fine on my local box but in production mode on textdrive  
I have to run it this way.

If someone has ideas of why this is the case I’d love to hear it.

Thanks-  
Michael

---

<div class="post-metadata">

**Author:** ![bluetrust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8e7dd6/32.png) [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Post date:** [February 19, 2007, 5:52pm UTC](https://www.ruby-forum.com/t/weird-extension-stuff-on-deployment/85874/4 "2007-02-19T17:52:16Z")

</div>

Michael,

Although I see why it was done initially, I personally have issues  
with namespaced controllers. You probably failed to put the  
controller inside the Admin module, or put it in the wrong directory,  
which happens all the time. For the most part, it’s just easier to  
change the route and keep the controller in the root namespace.

Sean
