sgchecker
sgchecker

Reputation: 63

RoR Tutorial Section 5.5 db:migrate error

i'm new to Ruby. I'm at RoR Getting Started Section 5.5 and after running db:migrate, got the below error. Any advise on why? I can't find any answers or solution or problem. Pls help.

$ bin/rake db:migrate

== 20150207172154 CreateArticles: migrating =================================== -- create_table(:articles) -> 0.0017s == 20150207172154 CreateArticles: migrated (0.0019s) ==========================

rake aborted! StandardError: An error has occurred, this and all later migrations canceled:

wrong number of arguments (1 for 0)-e:1:in <main>' ArgumentError: wrong number of arguments (1 for 0) -e:1:in' Tasks: TOP => db:migrate (See full trace by running task with --trace)

Below is my migration file.

class CreateArticles < ActiveRecord::Migration    def change
    create_table :articles do |t|
      t.string :title
      t.text :text

      t.timestamps null: false
    end      
  end  
end

Upvotes: 2

Views: 75

Answers (1)

Ahmad Al-kheat
Ahmad Al-kheat

Reputation: 1795

This is an error that I ran into once, and it's because of Arel gem, to solve it, go to Gemfile, and add this line

gem 'arel', '6.0.0.beta2'

then run bundle from the terminal. If it complains about Arel, then install it from the terminal by typing bundle update arel. Then migrate your database again.

Upvotes: 2

Related Questions