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 5942661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:17:06+00:00 2026-05-22T16:17:06+00:00

I am trying to create this rails migration class CreateFormats < ActiveRecord::Migration def self.up

  • 0

I am trying to create this rails migration

class CreateFormats < ActiveRecord::Migration
  def self.up
    create_table (:formats , :options => 'ENGINE=InnoDB DEFAULT CHARSET=utf8' ) do |t|
      t.name
      t.description 
      t.company

      t.timestamps
    end
  end

  def self.down
    drop_table :formats
  end
end

And I get errors during execution that look like this:

syntax error, unexpected ‘,’, expecting ‘)’
create_table (:formats , :options => ‘ENGINE=InnoDB D…
^
syntax error, unexpected ‘)’, expecting keyword_end
…=InnoDB DEFAULT CHARSET=utf8′ ) do |t|
… ^

syntax error, unexpected keyword_end, expecting $end

Any idea why this happened? I can’t find any problems with my syntax..most likely because I am new to Rails 🙂

  • 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-05-22T16:17:07+00:00Added an answer on May 22, 2026 at 4:17 pm

    Your syntax is incorrect:

    create_table (:formats , :options => 'ENGINE=InnoDB DEFAULT CHARSET=utf8' ) do |t|
    

    should be

    create_table(:formats , :options => 'ENGINE=InnoDB DEFAULT CHARSET=utf8' ) do |t|
    

    i.e: without the space. Otherwise you are simply grouping :formats with :options => ... as the first argument to the function.

    You probably also need to change

    t.name
    t.description 
    t.company
    

    to something like

    t.string :name
    t.string :description 
    t.string :company
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to run this migration: class AddDroppedProjectsCountToUser < ActiveRecord::Migration def self.up
I'm trying to create this table in Rails: create_table :artist_names do |t| t.string :name
I'm trying to create a Rails app template I have this block of code
Trying to execute this statement in a rails migration to generate a multi column
I'm trying to create a Rails app without a persistence layer (ActiveRecord, MongoMapper, etc).
I am trying to create a frameset and I am doing this using Rails.
I am getting this error in rails whenever i am trying to create an
I am trying to create this QT gui using a thread but no luck.
I am trying to create this tooltip sample for my wordpress it works just
I am trying to create this simple application in c#: when the user double

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.