1

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.

Russ Bradberry
  • 10,705
  • 17
  • 69
  • 85
  • i got the same problem, but generate what is? cause inside of the rails app there is no a directory called generate inside of script. – lorbrito Jan 30 '11 at 14:35

3 Answers3

2

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.

marklai
  • 2,030
  • 1
  • 14
  • 14
0

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

Zepplock
  • 28,655
  • 4
  • 35
  • 50
0

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.

B Seven
  • 44,484
  • 66
  • 240
  • 385