I am currently using Rubymine for ruby on rails development.
After enjoying the console for testing purposes, I want to use the console instead of the build-in Rails Generator for creating new models and such.
But I can’t figure out how to use the rails console (Tools | Run Rails Console) for generating -lets say- a new model “user”.
rails generate model user name:string
gives me
NameError: undefined local variable or method `string’ for main:Object
I think I’m just missing something very basic here but I couldn’t come up with a solution by myself after several tries :/
I hope you can help me out.
Greets
If you feel that you really must use the console to do this, you have a few options to get to the system.
You can use backticks.
or
You can use system()
Your command would then look like
system("rails generate model user name:string")or it would look like`rails generate model user name:string`