I’m writing a tutorial where I demo some rails commands. On my machine rails and script/rails both work equally well. Is there a “preferred” form? Which of the two works more universally?
I’m writing a tutorial where I demo some rails commands. On my machine rails
Share
When you run the
railsexecutable within a Rails 3 application, it looks for thescript/railsfile and, if it’s present, executes that file with the arguments you passed torails.The reason why you’d use
railsoverscript/railsgenerally falls down to the fact that it’s shorter.One more thing to note, there’s also the
rails ccommand which, in a Rails 2 application, will generate an application folder calledcinside the current directory. Usingscript/rails, this wouldn’t happen; instead it would complain that thescript/railsdoesn’t exist.