# Problem getting rails1 app running under rails2

**URL:** <https://www.ruby-forum.com/t/problem-getting-rails1-app-running-under-rails2/153757>\
**Category:** Rails\
**Created:** [November 20, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/problem-getting-rails1-app-running-under-rails2/153757 "2008-11-20T20:40:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpollans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@wpollans](https://www.ruby-forum.com/u/wpollans)\
**Post date:** [November 20, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/problem-getting-rails1-app-running-under-rails2/153757/1 "2008-11-20T20:40:18Z")

</div>

I’m sure others have already solved this problem - porting an existing  
rails1 app to rails2.

A sketch of the problem - I’ll be happy to furnish as much detail as  
may be needed - I’m hoping this is/was a standard problem.

I’ve just upgraded to current rails gem (2.1.2) from 1.2.5 and can’t  
get my app going. It appears that my standard.rhtml (renamed to  
standard.html.erb - along with other \*.rhtml) is not being rendered -  
there’s no mention of it (in the window in which script/server is  
running) when I open the app in the browser - the view is rendered,  
but without the appropriate css. standard.rhtml created the  
navigation panes used in all views. I’m using FF3 and ubuntu hardy -  
shouldn’t be relevant since rails1 app was running OK in this  
environment.

Could someone please point to where I need to look. Any and all help  
appreciated

---

<div class="post-metadata">

**Author:** ![wpollans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@wpollans](https://www.ruby-forum.com/u/wpollans)\
**Post date:** [November 20, 2008, 10:11pm UTC](https://www.ruby-forum.com/t/problem-getting-rails1-app-running-under-rails2/153757/2 "2008-11-20T22:11:31Z")

</div>

This message used to appear in the script/server output, when the app  
started,

“Rendering within layouts/standard”

that’s the standard.rhtml (in layouts) that was referring to

---

<div class="post-metadata">

**Author:** ![wpollans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@wpollans](https://www.ruby-forum.com/u/wpollans)\
**Post date:** [November 21, 2008, 3:52am UTC](https://www.ruby-forum.com/t/problem-getting-rails1-app-running-under-rails2/153757/3 "2008-11-21T03:52:45Z")

</div>

Hi,  
I haven’t had this particular problem with converting an app, but I have  
found a way to convert that seems very painless and quick for me.  
Worked well twice now.

I just create a new rails 2.x app, and then copy the appropriate stuff  
over from the old app (like all of the stuff in apps folder, and  
plugins, etc.)

I have NOT found it necessary to rename the endings of the view files.  
2.x is backwards compatible with the “old” .rhtml ending.

Just the other day I got a medium sized project converted and working in  
just a few hours, including setting it all up on a new server box.

Copying stuff into a new rails project seems a lot easier than doctoring  
up an old project to make it 2.x compatible.

HTH,  
jp

wpollans wrote:

> This message used to appear in the script/server output, when the app  
> started,
> 
> “Rendering within layouts/standard”
> 
> that’s the standard.rhtml (in layouts) that was referring to

---

<div class="post-metadata">

**Author:** ![wpollans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@wpollans](https://www.ruby-forum.com/u/wpollans)\
**Post date:** [November 21, 2008, 4:22pm UTC](https://www.ruby-forum.com/t/problem-getting-rails1-app-running-under-rails2/153757/4 "2008-11-21T16:22:41Z")

</div>

OK, I think I see the problem, but not the solution.

My ApplicationController contains the line “layout ‘standard’”

Is this command is no longer valid? It seems that it’s not doing what  
it used to.

Here’s the class:

$ cat application.rb

# Filters added to this controller apply to all controllers in the

application.

# Likewise, all the methods added will be available for all

controllers.

class ApplicationController \< ActionController::Base  
layout ‘standard’

# Pick a unique cookie name to distinguish our session data from

others’  
session :session\_key =\> ‘\_dancedb\_session\_id’  
end

---

<div class="post-metadata">

**Author:** ![wpollans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@wpollans](https://www.ruby-forum.com/u/wpollans)\
**Post date:** [November 21, 2008, 9:16pm UTC](https://www.ruby-forum.com/t/problem-getting-rails1-app-running-under-rails2/153757/5 "2008-11-21T21:16:40Z")

</div>

OK, yet again - putting “layout ‘standard’” in EACH of my controllers  
works!  
Having “layout ‘standard’” in ApplicationController but not in  
individual controllers does not work.

So, it seems that the individual controllers are not inheriting from  
ApplicationController as I thought they should (and used to do).

Is it possible that I have configured (or failed to configure)  
something to make this happen?

I’m happy that the app works again, but am confused about what  
changed.
