# Edge Rails: parse error, unexpected $, expecting kEND

**URL:** <https://www.ruby-forum.com/t/edge-rails-parse-error-unexpected-expecting-kend/81422>\
**Category:** Rails\
**Created:** [January 9, 2007, 12:26am UTC](https://www.ruby-forum.com/t/edge-rails-parse-error-unexpected-expecting-kend/81422 "2007-01-09T00:26:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sydneystephen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@sydneystephen](https://www.ruby-forum.com/u/sydneystephen)\
**Post date:** [January 9, 2007, 12:26am UTC](https://www.ruby-forum.com/t/edge-rails-parse-error-unexpected-expecting-kend/81422/1 "2007-01-09T00:26:06Z")

</div>

New to this environment and working my way through “Agile Web  
Development with Rails”. I had a problem with decimal fields and am  
using Edge Rails now to get around that issue - only I am now  
experiencing other problems…

If you have this book, the exercise is Iteration A4: Prettier Listings

I have generated some ruby script with the command: ruby script/generate  
scaffold product admin

The script produced is as follows:

class AdminController \< ApplicationController  
def index  
list  
render :action =\> ‘list’  
end

# GETs should be safe (see

[URIs, Addressability, and the use of HTTP GET and POST](http://www.w3.org/2001/tag/doc/whenToUseGet.html))  
verify :method =\> :post, :only =\> [:destroy, :create, :update],  
:redirect\_to =\> { :action =\> :list }

def list  
@product\_pages, @products = paginate :products, :per\_page =\> 10  
end

def show  
@product = Product.find(params[:id])  
end

def new  
@product = Product.new  
end

def create  
@product = Product.new(params[:product])  
if @product.save  
flash[:notice] = ‘Product was successfully created.’  
redirect\_to :action =\> ‘list’  
else  
render :action =\> ‘new’  
end  
end

def edit  
@product = Product.find(params[:id])  
end

def update  
@product = Product.find(params[:id])  
if @product.update\_attributes(params[:product])  
flash[:notice] = ‘Product was successfully updated.’  
redirect\_to :action =\> ‘show’, :id =\> @product  
else  
render :action =\> ‘edit’  
end  
end

def destroy  
Product.find(params[:id]).destroy  
redirect\_to :action =\> ‘list’  
end  
end

When this script is called ([http://localhost:3000/admin](http://localhost:3000/admin) the following  
error is generated:

app/models/product.rb:11: parse error, unexpected $, expecting kEND  
RAILS\_ROOT: script/…/config/…

Application Trace | Framework Trace | Full Trace  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:204:in  
`load_without_new_constant_marking' vendor/rails/activesupport/lib/active_support/dependencies.rb:204:in `load\_file’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:343:in  
`new_constants_in' vendor/rails/activesupport/lib/active_support/dependencies.rb:203:in `load\_file’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:95:in  
`require_or_load' vendor/rails/activesupport/lib/active_support/dependencies.rb:249:in `load\_missing\_constant’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:453:in  
`const_missing' vendor/rails/activesupport/lib/active_support/dependencies.rb:465:in `const\_missing’  
vendor/rails/activesupport/lib/active\_support/inflector.rb:162:in  
`constantize' vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb:148:in `constantize’  
vendor/rails/actionpack/lib/action\_controller/pagination.rb:195:in  
`paginator_and_collection_for' vendor/rails/actionpack/lib/action_controller/pagination.rb:130:in `paginate’  
app/controllers/admin\_controller.rb:12:in `list' app/controllers/admin_controller.rb:3:in `index’  
vendor/rails/actionpack/lib/action\_controller/base.rb:1092:in  
`perform_action_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:632:in `call\_filter’  
vendor/rails/actionpack/lib/action\_controller/filters.rb:634:in  
`call_filter' vendor/rails/actionpack/lib/action_controller/filters.rb:619:in `perform\_action\_without\_benchmark’  
vendor/rails/actionpack/lib/action\_controller/benchmarking.rb:66:in  
`perform_action_without_rescue' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure’  
vendor/rails/actionpack/lib/action\_controller/benchmarking.rb:66:in  
`perform_action_without_rescue' vendor/rails/actionpack/lib/action_controller/rescue.rb:115:in `perform\_action’  
vendor/rails/actionpack/lib/action\_controller/base.rb:427:in  
`process_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:624:in `process\_without\_session\_management\_support’  
vendor/rails/actionpack/lib/action\_controller/session\_management.rb:114:in  
`process' vendor/rails/actionpack/lib/action_controller/base.rb:330:in `process’  
vendor/rails/railties/lib/dispatcher.rb:39:in `dispatch' vendor/rails/railties/lib/webrick_server.rb:112:in `handle\_dispatch’  
vendor/rails/railties/lib/webrick\_server.rb:78:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service’  
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start\_thread’  
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start’  
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start’  
/usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start' vendor/rails/railties/lib/webrick_server.rb:62:in `dispatch’  
vendor/rails/railties/lib/commands/servers/webrick.rb:59  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require' vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in `require’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:343:in  
`new_constants_in' vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in `require’  
vendor/rails/railties/lib/commands/server.rb:39  
script/server:3

The error apparently means a missing “end” but i cannot see where…

Any clues?

---

<div class="post-metadata">

**Author:** ![sydneystephen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@sydneystephen](https://www.ruby-forum.com/u/sydneystephen)\
**Post date:** [January 9, 2007, 12:52am UTC](https://www.ruby-forum.com/t/edge-rails-parse-error-unexpected-expecting-kend/81422/2 "2007-01-09T00:52:03Z")

</div>

Hi –

On Tue, 9 Jan 2007, Stephen Jones wrote:

> The script produced is as follows:
> 
> class AdminController \< ApplicationController  
> def index

…

> When this script is called ([http://localhost:3000/admin](http://localhost:3000/admin) the following  
> error is generated:
> 
> app/models/product.rb:11: parse error, unexpected $, expecting kEND  
> RAILS\_ROOT: script/…/config/…

It’s hard to know the problem without seeing product.rb.

David

–  
Q. What is THE Ruby book for Rails developers?  
A. RUBY FOR RAILS by David A. Black ([Ruby for Rails](http://www.manning.com/black))  
(See what readers are saying! [http://www.rubypal.com/r4rrevs.pdf](http://www.rubypal.com/r4rrevs.pdf))  
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?  
A. Ruby Power and Light, LLC ([http://www.rubypal.com](http://www.rubypal.com))

---

<div class="post-metadata">

**Author:** ![sydneystephen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@sydneystephen](https://www.ruby-forum.com/u/sydneystephen)\
**Post date:** [January 9, 2007, 3:22am UTC](https://www.ruby-forum.com/t/edge-rails-parse-error-unexpected-expecting-kend/81422/3 "2007-01-09T03:22:14Z")

</div>

Hey Stephen, if you’re using AWDwRv2, I would recommend using rails  
1.2 RC 2 to work your way through the book because it’s covering the  
features of rails 1.2. Also, you should be aware that Edge is a  
development branch. Thus, things may or may not work.

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![sydneystephen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@sydneystephen](https://www.ruby-forum.com/u/sydneystephen)\
**Post date:** [January 9, 2007, 6:17am UTC](https://www.ruby-forum.com/t/edge-rails-parse-error-unexpected-expecting-kend/81422/4 "2007-01-09T06:17:28Z")

</div>

Stephen Jones wrote:

> I did this, but rails -v still produces a version of 1.1.6.
> 
> Where else can I get Rails 1.2 RC 2 ?

That’s ok, rails -v will continue to say 1.1.6 until the official 1.2  
release is out.

If you want to make sure you’ve got the right version of rails, do  
this:

ruby script/about

If you see an “edge version” mentioned somewhere in the list of stats  
(a number greater than 5000 or so) then you’re all set.

Jeff

> **[Hey Daddio!](http://softiesonrails.com)**
>
> Home of Hey Daddio Software

---

<div class="post-metadata">

**Author:** ![sydneystephen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@sydneystephen](https://www.ruby-forum.com/u/sydneystephen)\
**Post date:** [January 9, 2007, 3:47am UTC](https://www.ruby-forum.com/t/edge-rails-parse-error-unexpected-expecting-kend/81422/5 "2007-01-09T03:47:50Z")

</div>

Conrad T. wrote:

> Hey Stephen, if you’re using AWDwRv2, I would recommend using rails  
> 1.2 RC 2 to work your way through the book because it’s covering the  
> features of rails 1.2. Also, you should be aware that Edge is a  
> development branch. Thus, things may or may not work.
> 
> Good luck,
> 
> -Conrad

Thanks Conrad. I have resolved my problem by finding a typo and  
correcting it. However I am still expecting ongoing problems with my  
current Rails release.

I thought I downloaded v1.2 - the book suggests:

Download [http://media.pragprog.com/titles/rails2/code/rails.zip](http://media.pragprog.com/titles/rails2/code/rails.zip) intoyour  
applicationâ€™s vendor directory and unzip it. It should create a  
newdirectory called rails In your applicationâ€™s top-level directory,  
issue the command rakerails:update

I did this, but rails -v still produces a version of 1.1.6.

Where else can I get Rails 1.2 RC 2 ?

Stephen

---

<div class="post-metadata">

**Author:** ![sydneystephen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@sydneystephen](https://www.ruby-forum.com/u/sydneystephen)\
**Post date:** [January 9, 2007, 6:45am UTC](https://www.ruby-forum.com/t/edge-rails-parse-error-unexpected-expecting-kend/81422/6 "2007-01-09T06:45:34Z")

</div>

> Where else can I get Rails 1.2 RC 2 ?
> 
> Stephen

I am not sure which version is available via the pragprog website, but  
you can install the latest version on your machine using:

gem install rails --source [http://gems.rubyonrails.org](http://gems.rubyonrails.org)  
–include-dependencies

Personally, I have refrained from doing that until it’s stamped 1.2  
proper and froze RC2 to a development app:

rake rails:freeze:edge TAG=rel\_1-2-0\_RC2
