Getting Started with Rails

Hi,

I noticed in ,"Getting Started with Rails"

http://guides.rubyonrails.org/getting_started.html

some of the examples are missing 'ruby' from the actual command syntax

section 4
"$ script/generate controller home index"

change to "$ ruby script/generate controller home index"

These should also contain 'ruby'

section 4.1
$ script/server

section 6
$ script/generate scaffold Post name:string title:string content:text

section 6.6
$ script/console

Kind Regards,
Rajinder Yadav

Well, this isn't required on platforms other than Windows, which, as I
understand it, is a minority within Rails developers.

Perhaps adding a note to the top that says "If on Windows, you'll need
to add `ruby` to the beginning of these commands" would be helpful,
but adding it to the beginning of all of them is unnecessary.

--Jeremy

Jeremy McAnally wrote:

Well, this isn't required on platforms other than Windows, which, as I
understand it, is a minority within Rails developers.

for consistency sake then you should consider revising

http://guides.rubyonrails.org/migrations.html

to omits 'ruby' from the command syntax, and likewise other pages

Rajinder, that is a good point.

I think Jeremy's suggestion is the way to go. However, in Rails 3
script/* is gone, and published guides are frozen.

So, all those examples now read "rails command ..." in docrails, which
is the new thing (preferred over script/rails).

-- fxn

PS: rails command is not portable at this moment, there's a pending
patch for that.

Rajinder, that is a good point.

I think Jeremy’s suggestion is the way to go. However, in Rails 3

script/* is gone, and published guides are frozen.

So, all those examples now read “rails command …” in docrails, which

is the new thing (preferred over script/rails).

– fxn

PS: rails command is not portable at this moment, there’s a pending

patch for that.

Well now that’s ironic! I though the only reason for adding all the new behavior to the rails command was so that the usage syntax could now be platform-independent.

Is there some other reason why the rails command is now a wrapper for script/*? Maybe I’m missing something obvious.

Thanks
Jeff

Problem is it is implemented using exec at this moment. That is not
portable because it needs script/rails to be executable.

I submitted a patch precisely because of this thread. The message is
that the rails command is the way to go, but if it is not portable
documentation will need ugly warnings as the ones Rajinder needed for
Windows:

    https://rails.lighthouseapp.com/projects/8994/tickets/4008-let-rails-use-load-to-interpret-scriptrails

Let's see.

Xavier Noria wrote:

Rajinder, that is a good point.

I think Jeremy's suggestion is the way to go. However, in Rails 3
script/* is gone, and published guides are frozen.

So, all those examples now read "rails command ..." in docrails, which
is the new thing (preferred over script/rails).

-- fxn

PS: rails command is not portable at this moment, there's a pending
patch for that.

Xavier, thanks for the update, it's good to know about the new developments.

Hey a followup on this, the patch has been applied

http://github.com/rails/rails/commit/bf0f14579aa793f2ab29ec092c517d04e702dbe3

So the rails command will work on Windows in the next beta, and it
also will recurse upwards looking for script/rails.

Awesome, thanks for writing the patch.

Jeff