JDillon522
JDillon522

Reputation: 19666

Rails generate model syntax error

I'm trying to generate a model from the command line. Here is my command:

rails generate model User first_name:string last_name:string email_address:string age:integer

And it keeps giving me this error:

SyntaxError: (irb):2: syntax error, unexpected tLABEL, expecting keyword_do or '{' or '('

User first_name:str last_name:**str** email_address:str age:int

(irb):2: syntax error, unexpected tLABEL, expecting keyword_do or '{' or '('

name:str email_address:str age:**integer**

I'm lost. I learned this yesterday and the syntax is exactly the same as before when it worked fine.

Thanks

Edit: StackOverflow wouldnt let me post this unless I formatted that error as code FYI

Upvotes: 2

Views: 1829

Answers (1)

Marek Lipka
Marek Lipka

Reputation: 51151

You should put this command in your system console, not Rails console.

Upvotes: 10

Related Questions