Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"rails generate model" hangs

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
like image 292
user1790039 Avatar asked Jul 08 '14 01:07

user1790039


People also ask

What are the useful features of generators in rails?

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:

How to create user model with email field type in rails?

$ 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

What is MVC in Ruby on rails?

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.

How to generate photos table with curly brace and index in rails?

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.


2 Answers

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.

like image 135
fearless_fool Avatar answered Oct 26 '22 22:10

fearless_fool


Don't kill spring, just use the built in spring stop

like image 43
Jordan Michael Rushing Avatar answered Oct 26 '22 20:10

Jordan Michael Rushing