Ruby On Rails Scaffold LoadError

2.1k views Asked by At

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.

3

There are 3 answers

1
marklai On BEST ANSWER

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.

0
B Seven On

This question is old, but for anyone who is having problems with "Head First Rails" first edition (which is the only one available at this time), it was written for rails 2. So most of the commands, like script/generate, have been replaced by new ones in Rails 3.

I suggest using "Agile Web Development with Rails" book.

0
Zepplock On

try simply "./script/generate ..." in your project directory