开发者

Ruby on Rails tutorial - generate question

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
Ac开发者_如何学运维tive Support version  2.3.5
Application root    /home/bitnami/src/rubytest0/my_test_app
Environment development
Database adapter    sqlite3
Database schema version 0


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜