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
You should put this command in your system console, not Rails console.
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