ruby-on-railsscaffoldingscriptgenerate

Ruby On Rails Scaffold LoadError


I am learning Ruby on Rails using a book I picked up called "Head First Rails" I am in the first chapter and it tells me to create my CRUD procedures using the following command:

ruby script/generate scaffold ticket name:string seat_id_seq:string address:text price_paid:decimal email_address:string

the error I am getting is:

ruby: No such file or directory -- script/generate (LoadError)

Can someone please explain what I am doing wrong. I am not new to development, I am a professional C# developer trying to learn Ruby on Rails.


Solution

  • Are you running that in your application directory? The scaffold command needs to be executed in your application directory in order to find script/generate.