Lesson 2 - 2/7 no-migration-file



as I can see this is a question that go ahead since November 2015 and no answers.

If someone assume that type this:

rails generate model Message

Will generate a file in the migrate directory, well it's wrong because the migrate folder will remain empty.

If your intention was, yo dude type this:

rails generate model Message

You will get this:

/home/ccuser/.gem/ruby/2.3.0/gems/activesupport-4.1.1/lib/active_support/values/time_zone.rb:285: warning:circular argument reference - now
invoke active_record
create db/migrate/20170307200525_create_messages.rb
create app/models/message.rb
invoke rspec
create spec/models/message_spec.rb

You will see this line?

create db/migrate/20170307200525_create_messages.rb

Cool, well it's a fake. You have to create manually the file and give it the time stamp name you see in your bash. What exactly write inside the file, meh, wait for someone else on this forum...


Hi @icks,

I didn't encounter this issue when I took the course. Could you please provide a link to the lesson so I can take a look?

And yes, you're correct that some of the terminal output is artificial.


it's the same lesson of all the others who faced the same problem, just type in the search no migration file or lesson 2 2/7



what in this lesson is not clear, if we, have to manually create this file or not, because from the lesson it seems that the migration file should be already there in the folder, while it's not


@icks The file should be automatically created by Rails. Could you try resetting the exercise and running the command again? Let me know if the same thing happens again, please.

The error didn't occur for me when I ran the command.


If the generate command didn't report an error then most likely it was created. That means that either a) the gui isn't up-to-date, or b) the file was later removed.
a) can probably be remedied by refreshing the browser
b) can probably be remedied by generating it again

It seems unlikely that the command is faked - the timestamp is the current time


it was not created and you can see it from the screenshot as the migrate folder is empty, but of course maybe I removed the file 'cause I needed to open this thread :°°D

It's obvious that the command is not faked, there was a thin line dividing reality and humor.

Before open this thread, browser has been refreshed and the procedure at point 1 repeated other 2 times giving 3 out of 3 no file in the migration folder.
Plus, again, since this problem is happened to other people, just because is not happening to the majority of you, it doesn't means that it doesn't exist, perhaps under some rare circumstances it happens.


Yep, today is a new day I'm going to start again and see what happen, will be the 4th time, maybe the good one, I'll let you know


Here I am.
So master, today we have an error message for the first time yeaaah, I mean it's something :smiley: so I did the rest, two times, but it's like if the reset doesn't delete the previous migration files created by the command line "rails generate model Message"
So I guess that these files are generated but they are not displayed inside db/migrate because if you see the screenshot, you will see that we have the seeds.rb file in db folder, but migrate folder is empty.


@icks No need to be sarcastic. And I'm not a master. Why're you getting rude? It serves no purpose.

So, it appears that @ionatan was correct about the file tree not updating correctly. I'd suggest trying in a different browser (for the different cache, etc.), to see if that fixes it.

If you wish, you could (also) report it as a bug to the team in the bug reporting section below the instructions on the left.

The terminal output I remember being faked was for bundle install. Since that returns errors occasionally now, I'm not sure if that's still fake or not. ¯\_(ツ)_/¯


I wasn't rude, I was just joking, relax -_-

the fact that the file tree is not updating correctly it's like to say "there's something wrong" so anything new.
Find out why typing the command line nothing did appear would be cool and also
find out why yesterday without a reset but just typing again "rails generate model Message" for other two times I didn't get the conflict message
find out why just after the exercise reset there's a conflict message and only after this the browser refresh works

..."fake" was a way to say...

and btw the command reset now, does not reset the first step of the exercise anymore, the files are always there, so if you wanna try to find out what's the problem with the browser is, you need to manually delete these files.

ok I can't recreate the problem, after manually deleted the files and launched again "rails generate model Message" the migration file appear correctly inside the folder without browser refresh


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.