# Some routes don't load in production

**URL:** <https://www.ruby-forum.com/t/some-routes-dont-load-in-production/181730>\
**Category:** Rails\
**Created:** [January 17, 2010, 9:21am UTC](https://www.ruby-forum.com/t/some-routes-dont-load-in-production/181730 "2010-01-17T09:21:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![carpeliam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e19adc/32.png) [@carpeliam](https://www.ruby-forum.com/u/carpeliam)\
**Post date:** [January 17, 2010, 9:21am UTC](https://www.ruby-forum.com/t/some-routes-dont-load-in-production/181730/1 "2010-01-17T09:21:38Z")

</div>

This one is really tricking me out. I’ve made a minimal sample app  
that reproduces the problem I’m facing, it’s at  
[http://github.com/carpeliam/plogger\_ts\_devise\_problem\_example](http://github.com/carpeliam/plogger_ts_devise_problem_example). Some  
minimal explanation is there as well, the rest of this note is both  
backstory and elaboration. I’m developing a blogging plugin  
[http://github.com/carpeliam/plogger](http://github.com/carpeliam/plogger) which is plugin-based itself (much  
like feather for Merb), where any features you want in addition to  
dead simple posting come in the form of plugins themselves. Instead of  
using generators, I’ve tried to keep everything out of the app and  
under vendor/plugins. This means that the Article class is in the  
plogger plugin, and any Sphinx-related modifications to Article are  
made in the plogger\_thinking\_sphinx plugin.

My problem is, for some reason, the modification I’m making in my  
plogger\_thinking\_sphinx plugin is throwing off some of my routes I’m  
using with other gems. Specifically, I’m using Devise for  
authentication, and my sign\_in/sign\_out links are disappearing-- but  
ONLY in “production” mode. In addition, any authentication-related  
before\_filters in my controllers are being ignored, so authentication  
is silently failing.

The offending code is in plogger\_thinking\_sphinx, where I’m adding  
define\_index to my model as follows:

require ‘thinking\_sphinx’  
Article.send :define\_index, &(lambda do  
indexes title  
indexes description  
indexes post  
has created\_at  
set\_property :delta =\> true  
end)

This works fine in “development” mode. I also don’t see any problems  
from just requiring “thinking\_sphinx”, I _only_ see problems when I  
call Article.send :define\_index. Why that would mess up my Devise  
routes, and even then only in production, I have no idea. Any insight  
into this problem would be deeply appreciated.
