# Strange error on the first request - trying to setup Rails 2.3.5 with Bundler

**URL:** <https://www.ruby-forum.com/t/strange-error-on-the-first-request-trying-to-setup-rails-2-3-5-with-bundler/184639>\
**Category:** Rails\
**Created:** [March 5, 2010, 3:31pm UTC](https://www.ruby-forum.com/t/strange-error-on-the-first-request-trying-to-setup-rails-2-3-5-with-bundler/184639 "2010-03-05T15:31:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![g0nzo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3bc359/32.png) [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Post date:** [March 5, 2010, 3:31pm UTC](https://www.ruby-forum.com/t/strange-error-on-the-first-request-trying-to-setup-rails-2-3-5-with-bundler/184639/1 "2010-03-05T15:31:39Z")

</div>

I’m trying to use Bundler for existing Rails 2.3.5 app and got a very  
strange problem.

The problem is that on the very first request only the contents of the  
action view file are rendered - i.e. when loading the home page  
(controller: home, action: index) I get only contents of the app/views/  
home/index.html.haml file as the response with no layout at all. On  
the second and on subsequent requests everything is ok.

I.e. if my app/views/layouts/application.html.haml file has just  
string “LAYOUT” and app/views/home/index.html.haml has string “VIEW”,  
I get “VIEW” as a response for the first request and “LAYOUT” as a  
response for the second request.

It causes problems i.e. when running Cucumber features, because i.e. I  
access login form that is rendered in the layout file 🙂

Any idea what can be wrong?

The app uses gems that need to be required in a special order (i.e.  
authlogic must be required before resource-controller), so I don’t use  
Bundler.require, but manually require all gems.

Cheers,  
Szymek
