21 Jan 2013, 18:57
Generic-user-small

Colin L (1 post)

Hi I have just bought the book and was starting with the depot application.

I am just running it for the first time after running ‘rails server’ command and I get the following:

SyntaxError in ProductsController#index

/Users/colinlambert/Desktop/depot/app/models/product.rb:2: syntax error, unexpected ‘:’, expecting keyword_end attr_accessible : title, :description, :image_url, :price ^ /Users/colinlambert/Desktop/depot/app/models/product.rb:2: syntax error, unexpected ‘,’, expecting tCOLON2 or ‘[’ or ‘.’ attr_accessible : title, :description, :image_url, :price ^

Rails.root: /Users/colinlambert/Desktop/depot

Application Trace | Framework Trace | Full Trace app/controllers/products_controller.rb:1:in `<top (required)>’

Request

Parameters:

None Show session dump

Show env dump

Response

Headers:

None

28 Jan 2013, 02:59
Generic-user-small

Adrian Lee Elder (9 posts)

Could you post the contents of your product.rb and ProductsController.rb?

At first glance it looks like a type o when generating the Product scaffolding. Try rails destroy Product, and retyping out the command.

  You must be logged in to comment