I'm new to ROR.
How can I use the same App name after I delete my rails App?
Following are the actions I performed. Step #6 is my problem.
1 - Environment
- OS : Ubuntu 12.04.4
- ruby : 2.1.1p76
- rails : 4.1.2
- DB : SQLite
2 - Create rails App :
rails new myApp
=> OK
3 - Create model :
rails generate model mytable name:string
=> OK.
4 - Delete rails App :
rm -rf myApp
=> OK
5 - Re-Create rails App :
rails new myApp
=> OK
6 - Re-Create model :
rails generate model mytable name:string
=> Not OK! waiting for infinite time
And the last useful feature of generators - it’s options to generate reference columns (fields which are used in rails as foreign keys): This command will generate photos table with integer field album_id and also it will add index for this field automatically. Make sure in it by looking at generated migration:
$ rails g model user email This command will generate user model with email field type of string, migration which creates users table, test for model and factory (if you have it). You are able to generate model with few fields like this: $ rails g model user first_name last_name email
Learn how to create, read, update, and destroy data from the database with models. Ruby on Rails is the premier example of a framework that uses the MVC architectural pattern. The M stands for model, and models are used in Rails to represent business data and logic.
You can combine any single curly brace option with the index options: And the last useful feature of generators - it’s options to generate reference columns (fields which are used in rails as foreign keys): This command will generate photos table with integer field album_id and also it will add index for this field automatically.
Just a hunch, but by any chance, are you still running a server process somewhere on your machine? That could be holding a lock that is preventing the new table from getting built.
Don't kill spring, just use the built in spring stop
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With