I got the following error when migrating, so write it as a memorandum
== 20~~~~~~~~~~~ CreateBoards: migrating =====================================
-- create_table(:boards)
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
private method `String' called for 〜〜〜〜〜〜〜〜〜
Migration file
class CreateBoards < ActiveRecord::Migration[6.0]
def change
create_table :boards do |t|
t.String :title
t.String :text
t.timestamps
end
end
end
It seems to be useless if S of string is capitalized Correct to lowercase to resolve
class CreateBoards < ActiveRecord::Migration[6.0]
def change
create_table :boards do |t|
t.string :title
t.string :text
t.timestamps
end
end
end
https://stackoverflow.com/questions/4003651/ruby-on-rails-rake-dbmigrate-error/4003717
Recommended Posts