This project is archived and is in readonly mode.

#4665 open
Pyry Jahkola

Suggestion: Change to create Rails 3.0 apps by `rails init app-name`

Reported by Pyry Jahkola | May 22nd, 2010 @ 01:50 PM

Suggestion

Please consider changing the Rails initialization command from "rails app-name" to "rails init app-name".

Rationale

Too often it happens that I try to run a Rails command like "rails s" accidentally under a non-Rails directory. That leads to unwished new directories named "s" or "console" etc.

It seems to me, creating new Rails apps doesn't happen too often to oppose adding these additional five (or two, shortcut "i") key presses to the command line syntax.

The changed syntax would be in line with e.g. Git commands.

Proposal for new command line messages

Under a non-Rails directory

  • "rails" — shows the help message just like now (just change the Usage & Example texts accordingly to "rails init ...")
  • "rails init" — creates a new Rails 3.0 application in current directory
  • "rails init ." — ditto
  • "rails init app-name" — creates a new Rails 3.0 application under ./app-name
  • "rails cmd" — returns printing something along the following to stdout:
    This is not a Ruby on Rails project. Did you mean to create one?
    Use 'rails init cmd' to create a Rails application named "cmd".
    Type 'rails' for help.
    

Under a Rails directory

  • "rails" — shows the help message just like now
  • "rails init [arg]" — prints something like:
    Can't initialize a new Rails application within the directory of another,
    please change to a non-Rails directory first.
    Type 'rails' for help.
    

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages