実用的なプログラマー「Agile Web Development with Rails」から Ruby on Rails を学び始めたばかりです。
小さなアプリケーションを作成しましたが、実行すると次の構文エラーが発生します。
/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)>'
DB のコードは次のとおりです。
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
バージョンは次のとおりです。 ruby 1.9.3p362 Rails 3.2.11
sqlite のインストールを確認する必要がありますか?