Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

[Ruby 3] Wrong number of arguments (given 2, expected 1) #44

@lucascaton

Description

@lucascaton

Hi there,

When I was upgrading a Rails 6.1 app from Ruby v2 to v3, migrations stopped working. Here's an example:

create_table :my_table, id: :uuid, default: nil do |t|
  # ...
end

And here's the output:

== 20210000000000 CreateMyTable: migrating =========================
-- create_table(:my_table, {:id=>:uuid, :default=>nil})
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:

wrong number of arguments (given 2, expected 1)

./db/migrate/20210000000000_create_my_table.rb:3:in `change'
./bin/rails:5:in `<top (required)>'

By removing the zero_downtime_migrations gem, everything works as expected :)

Cheers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions