Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9170537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:02:15+00:00 2026-06-17T16:02:15+00:00

I have just started learning Ruby on Rails from pragmatic programmers ‘Agile Web Development

  • 0

I have just started learning Ruby on Rails from pragmatic programmers ‘Agile Web Development with Rails’.

I have wrote a small application and when it runs I receive the following syntax error when I run it:

/Users/colinlabri/Desktop/depot/app/models/product.rb:2: syntax error, unexpected ':',   expecting keyword_end
  attr_accessible : title, :description, :image_url, :price
                   ^
/Users/colinlabri/Desktop/depot/app/models/product.rb:2: syntax error, unexpected ',', expecting tCOLON2 or '[' or '.'
  attr_accessible : title, :description, :image_url, :price
                                        ^
 Rails.root: /Users/colinlabri/Desktop/depot

Application Trace | Framework Trace | Full Trace

app/controllers/products_controller.rb:1:in `<top (required)>'

The code for the DB is as follows:

class CreateProducts < ActiveRecord::Migration
  def change
    create_table :products do |t|
      t.string : title
      t.text :description
      t.string :image_url
      t.decimal :price, precision: 8, scale: 2

      t.timestamps
    end
  end
end

Versions are as follow:
ruby 1.9.3p362
Rails 3.2.11

Should I be checking my sqlite installation and how so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:02:16+00:00Added an answer on June 17, 2026 at 4:02 pm

    You just need to fix this line:

    t.string : title
    

    to:

    t.string :title
    

    Your model also has the same problem in the attr_accessible call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started learning ruby on rails. I'm using 'Agile Web Development with Rails,
I have just started learning ruby on rails. I have a doubt wrt routing.
I have just started learning Ruby on Rails. I happened to look for prevention
I have just started learning ruby reading from different resources. One of them is
I have just started out learning rails and ruby, so please bear with me
I have just started learning Rails, is it required for me to learn CoffeeScript
I have started learning Ruby and just tried out my first hello world program
I've only just started learning ruby on rails and I would like to create
I have just started learning python and am getting caught up. I come from
I have just started learning MySQL and am having trouble extracting matching flights from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.