1.4. Rails Commands and Configuration
Once Rails is installed, the rails command can be used to generate new Rails applications with a default directory structure and configuration at the path you specify.
To create a Rails application called myapp, type:
Once this is run, you will see a list of directories and files displayed that were generated by the command. This is your Rails application, with myapp being the base folder, or RAILS ROOT.
1.4.1. Usage and Options
For help with the rails command, type:
rails [/path/to/your/appname] [options]
Path to the Ruby binary of your choice
Preconfigured for a selected database (e.g., mysql, oracle, postgresql, sqlite2, sqlite3)
Freezes Rails in vendor/rails from the gems generating the skeleton
Shows the Rails version number and quits
Runs but does not make any changes
Overwrites files that already exist
Skips files that already exist
Suppresses normal output
Debugging; shows backtrace on errors
Modifies files with subversion (svn must be in path)
1.4.2. Rails File Structure
After generating a Rails application, a default directory and file structure is created. See Table 1-1.
|app||Holds all the code that’s specific to this particular application.|
|app/controllers||Holds controllers that should be named like users_controller.rb for automated ...|