# Rails loads wrong files

**URL:** <https://www.ruby-forum.com/t/rails-loads-wrong-files/163111>\
**Category:** Rails\
**Created:** [March 17, 2009, 12:59pm UTC](https://www.ruby-forum.com/t/rails-loads-wrong-files/163111 "2009-03-17T12:59:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 17, 2009, 12:59pm UTC](https://www.ruby-forum.com/t/rails-loads-wrong-files/163111/1 "2009-03-17T12:59:07Z")

</div>

I run in to errors which I dont understand:  
I never get the newest version of code (xxx.html.erb) displayed,  
instead  
my editors backupfile (xxx.html.erb.bak) are loaded/run.

I run Rails v2.3.2 (I am new. How to install 2.0.2? “gem install  
rails”  
put 2.3.2. on my windows xp machine)

Situation:

1. In my app there are some files (xxx.html.erb) as it should be.  
These files above I have been written and edited with my editor (i.e.  
UltraEdit)  
/rails\_apps/coconut/app/views/flights/show.html.erb  
/rails\_apps/coconut/app/views/flights/\_new\_seat.html.erb  
/rails\_apps/coconut/app/views/flights/\_seat\_list.html.erb

2. The Editor saves backup files from the last version of the file  
with  
extension .bak, like (xxx.html.erb.bak):  
/rails\_apps/coconut/app/views/flights/show.html.erb.bak  
/rails\_apps/coconut/app/views/flights/\_new\_seat.html.erb.bak  
/rails\_apps/coconut/app/views/flights/\_seat\_list.html.erb.bak

3. When I make a mistake in coding, the error page displayed concerns  
the backup files (xxx.html.erb.bak), not the xxx.html.erb files!!!  
So I never get the newest version of code (xxx.html.erb) loaded nor  
displayed.

4. When there is a backup file (i.e.  
app/views/flights/show.html.erb.bak), Rails error page shows content  
of  
the backup file (xxx.thml.erb.bak), not of the current file  
(xxx.html.erb):

####### START #################

## 

## 

Errno::ENOENT in Flights#show

Showing app/views/flights/show.html.erb.bak where line #29 raised:

No such file or directory -  
C:/InstantRails/rails\_apps/coconut/app/views/flights/  
\_new\_seat.html.erb.bak

Extracted source (around line #29):

26:  
27: \<%= render :partial=\>“seat\_list”, :locals=\>{:seats=\>@flight.seats}  
%\>  
28:  
29: \<%= render :partial=\>“new\_seat”,  
:locals=\>{:seat=\>Seat.new(:flight\_id=\>@flight.id)} %\>  
30:  
31: \<%= link\_to ‘Edit’, edit\_flight\_path(@flight) %\> |  
32: \<%= link\_to ‘Back’, flights\_path %\>

## 

## 

####### END #################

1. When I have deleted the editors backup file, but the xxx.htm.erb  
file  
ist still here, I got the folowing error:

####### START #################

## 

## 

Error message: “Missing template flights/\_seat\_list.erb in view path  
app/views”  
…

## 

## 

####### END #################

1. Any ideas why Rails loads not the xxx.html.erb files?  
Is this located only on Rails v2.3.2?
