dfang
dfang

Reputation: 1386

why run rails command from an rails application directory and non-rails directory differs?

a silly question:

when i run rails in an rails app , it shows

Usage: rails COMMAND [ARGS]

The most common rails commands are:
generate    Generate new code (short-cut alias: "g")
.....

but outside from rails app, it shows:

Usage:
rails new APP_PATH [options]

Options:
 -r, [--ruby=PATH]              # Path to the Ruby binary of your choice
 .....

why ?

Upvotes: 0

Views: 56

Answers (1)

Vadym Chumel
Vadym Chumel

Reputation: 1776

If you check sources you will see that it basically checks for existence of './script/rails' and runs it if it's found. So if there's no such - it just shows different output.

Upvotes: 1

Related Questions