The story that I struggled because I couldn't do "Rails db: migrate".

At one point, when I tried rails db: migrate, StandardError: An error has occurred, all later migrations canceled: An error has occurred.

First rake db: reset and then Trying to solve it by rails db: migrate again,

I get an error and can't even rake db: reset.

Check here if there are any mistakes in the migration file.

However, no matter how many times I checked, there was no spelling mistake.

I searched quite a bit. And at one point

** "Oh, full-width characters are included." **

Yes, it's a solution.

When I couldn't rails db: migrate, I had a misspelling or double-byte characters. I have a lot of things like that.

It's a simple matter, but this time it took some time to investigate the cause.

I think that beginners, including myself, often have trouble with migration files. rails At the beginning of the beginning I accidentally deleted the migration file, or corrected it without rolling back ... It's scary.

"You have to be careful when handling migration files" I realized again that.

Recommended Posts

The story that I struggled because I couldn't do "Rails db: migrate".
[Rails] I want to reset everything because the data in the local environment is strange! What to do before that
Note that I stumbled upon building the Rails environment
[Rails] What to do when rails db: migrate cannot be done because there is no table referenced by the foreign key
About the error that occurred when adding the column name in rails (rails db: migrate, rails db: rollback, add)
# What to do if you accidentally do rails db: migrate: drop
Error in rails db: migrate
[Rails] What to do when the error No database selected and Unknown database appears in db: migrate
A story that I struggled to challenge a competition professional with Java
The story of Collectors.groupingBy that I want to keep for posterity
The story of stopping because the rails test could not be done
[Rails] I tried deleting the application
The story I wanted to unzip
[Rails] Modify migrate file (rails db: rollback)
[Rails] I tried to implement a transaction that combines multiple DB processes
I was addicted to scrollview because I couldn't tap the variable size UIView