# Compile error question on a login.rhtml file (text included)

**URL:** <https://www.ruby-forum.com/t/compile-error-question-on-a-login-rhtml-file-text-included/105543>\
**Category:** Rails\
**Created:** [May 30, 2007, 10:35pm UTC](https://www.ruby-forum.com/t/compile-error-question-on-a-login-rhtml-file-text-included/105543 "2007-05-30T22:35:32Z")\
**Posts on this page:** 3\
**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:** [May 30, 2007, 10:35pm UTC](https://www.ruby-forum.com/t/compile-error-question-on-a-login-rhtml-file-text-included/105543/1 "2007-05-30T22:35:32Z")

</div>

I am working my way through the January 2007 edition of “Build Your  
Own Ruby on Rails Web Applications” by Patrick Lenz. The application  
in the book is a clone of [digg.com](http://digg.com) and I am halfway through the book  
with no problems.

I am now working on the user authentication portion, and I am getting  
a compile error with the following 12 line file (typed exactly as  
printed in the book):

\<% form\_tag do %\>

Please log in.

Username: \<%= text\_field\_tag 'login' %\>

Password: \<%= password\_field\_tag 'password' %\>

\<%= submit\_tag 'login' %\>

\<% end\_form %\>

The compile error is:

compile error  
C:/CONDUC~1/rails\_apps/shovell/config/…/app/views/account/login.rhtml:  
13: parse error, unexpected $, expecting kEND

Extracted source (around line #13):

10:

  
11: 

\<%= submit\_tag ‘login’ %\>

  
12: \<% end\_form %\>

My application’s environment is:

Ruby version 1.8.5 (i386-mswin32)  
RubyGems version 0.9.2  
Rails version 1.2.3  
Active Record version 1.15.3  
Action Pack version 1.13.3  
Action Web Service version 1.2.3  
Action Mailer version 1.3.3  
Active Support version 1.4.2  
Application root C:/CONDUC~1/rails\_apps/shovell  
Environment development  
Database adapter mysql  
Database schema version 4

I suspect that I have a typo somewhere, but I need a fresh set of eyes  
to review what I have typed to uncover it. I realize that there might  
be a version differential between what I have installed on my laptop  
and the version used in the book (Ruby 1.8.4, Rails 1.2 Release  
Candidate 2, MySQL General Release 5.0.27).

Thanks in advance for your guidance!

John

---

<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:** [May 30, 2007, 10:38pm UTC](https://www.ruby-forum.com/t/compile-error-question-on-a-login-rhtml-file-text-included/105543/2 "2007-05-30T22:38:33Z")

</div>

On May 30, 2007, at 4:34 PM, removed\_email\_address@domain.invalid wrote:

> Please log in.
> 
> The compile error is:
> 
> compile error  
> C:/CONDUC~1/rails\_apps/shovell/config/…/app/views/account/  
> login.rhtml:  
> 13: parse error, unexpected $, expecting kEND

You have two different approaches to building form mixed up here. If  
you’re starting a form with

\<% form\_tag do %\>

then you need

\<% end %\>

to match the ‘do’. (everything between them is considered a block. So  
your form should be:

\<% form\_tag do %\>

Please log in.

Username: \<%= text\_field\_tag 'login' %\>

Password: \<%= password\_field\_tag 'password' %\>

\<%= submit\_tag 'login' %\>

\<% end %\>

For more, look at the form\_tag API documentation at:

[http://rails.rubyonrails.org/classes/ActionView/Helpers/](http://rails.rubyonrails.org/classes/ActionView/Helpers/)  
FormTagHelper.html#M000601

James.

–  
James S.  
Play: [http://james.anthropiccollective.org](http://james.anthropiccollective.org)  
Work: [http://jystewart.net/process/](http://jystewart.net/process/)

---

<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:** [May 30, 2007, 10:55pm UTC](https://www.ruby-forum.com/t/compile-error-question-on-a-login-rhtml-file-text-included/105543/3 "2007-05-30T22:55:35Z")

</div>

> your form should be:
> 
> -- James S. Play:http://james.anthropiccollective.org Work:http://jystewart.net/process/

James,

Thank you for clarifying that point and providing the online reference  
resource as well! I made the change and it worked instantly. This is  
my first efforts at Ruby on Rails (and programming in general) with a  
mountain of things to learn. I hope to arrive at a point of  
proficiency where I can contribute similar guidance to another newbie  
in the near future.

Thanks again!

John
