2
votes

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
1
When posting a question on SO please post the information that is related to your question and necessary to answer. In this instance we need to see your migration file.heading_to_tahiti
oic. will do that in future. what's SO?sgchecker
SO = Stack Overlow = This site you posted this questions onheading_to_tahiti

1 Answers

2
votes

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.