Sunday, February 20, 2011

Where did the scripts go?


The recent commit removing the contents of the script directory streamlines rails somewhat. But there were a lot of files in that directory, this is a quick cheat sheet on what replaces what…
The script directory used to contain
Old Script FileHow to use nowShortcut Command
aboutrake about
serverrails serverrails s
consolerails consolerails c
dbconsolerails dbconsolerails db
generaterails generaterails g
destroyrails destroy
performance/benchmarkrails benchmark
performance/profilerrails profiler
pluginrails plugin
runnerrails runner
As you can see from the above, the serverconsoledbconsole andgenerate parameters also have shortcut aliases.
When you run the rails command from within a Rails application directory, the above commands work, however, if you run the railscommand from outside a Rails application directory, then the usual Rails initialization command works in the format of rails/railties/bin/rails APP_PATH [options]
Note with the new 3.0 rails command, the APP_NAME has been changed to an APP_PATH and any options now come at the end, not before. APP_PATHallows you to initialise a new Rails application at some other path name and uses the last part of the path name for your application.
One word of warning, if you are running the Rails 3.0 Beta using the —devflag from a clone of the Rails source tree, then be sure to callscript/rails otherwise the rails binary that is run will be from your system gems, and you will end up initialising a new Rails application inside your new Rails 3 app directory.

No comments:

Post a Comment