views:

33

answers:

2

First attempt at a RoR project and following http://guides.rubyonrails.org/getting_started.html#creating-the-blog-application .

I've got the "Welcome Aboard" page serving.

Within the section 4.2 Say "Hello", Rails the tutorial says to issue the command :

$rails generate controller home index 

... and that that will create a file

app/views/home/index.html.erb

... well as far as I can see it doesn't. In fact in the app/views directory there is no sub-directory called 'home' but instead one called 'layout' (which is empty)

When I issue a find command for index the file the file index.html.erb appears nowhere in the tree.

Can anyone provide me with advice on how to make that index.html.erb file (preferably in a manner compatiable with the tut !).

My environment is based on bitnami over ubuntu and looks like this :

Ruby version    1.8.7 (i686-linux)
RubyGems version    1.3.6
Rack version    1.0
Rails version   2.3.5
Active Record version   2.3.5
Active Resource version 2.3.5
Action Mailer version   2.3.5
Active Support version  2.3.5
Application root    /home/bitnami/src/rubytest0/my_test_app
Environment development
Database adapter    sqlite3
Database schema version 0
+2  A: 

The tutorial you are referring to explicitly states:

"This Guide is based on Rails 3.0. Some of the code shown here will not work in earlier versions of Rails."

It looks like you are using rails 2.3.5

ennuikiller
Thanks. I found the tutorial after I'd found several others and overlooked the version statement
+1  A: 

If you're using rails pre-3.0 try...

script/generate (instead of rails generate) in the root directory of your Rails project.

Older versions of rails don't allow 'rails generate', so you essentially created a new rails app called generate. As you continue to follow the tutorial, replace any instance of rails command with script/command if you are having trouble.

mark
Thanks for your help. Unfortunately I found that when I issue that command I get this :
createFile exists - ./script/generate
... and yet I have, subsequent to reading your answer, found the same advice elsewhere so you're obviously correct but I can't figure out why my environment responds as it does.
Anyway I'm having troubles finding tuts based on RoR 2.x (and bitnami doesn't have a RoR 3.x ami) so I'm going to try installing RoR on a clean Ubuntu instance.
One last thing. I've now followed the instructions at http://web2linux.com/installing-rails-3-on-ubuntu-10-04-lucid-lynx/ and applied them to a Lucid Lynx ami . I've followed those instructions more or less as written (there are some bits in the comments which are worth taking note of) and I've been able to execute the "rails generate controller ..." command successfully.