Ruby on Rails/Getting Started/Creating a Rails application

From Wikibooks, open books for an open world
< Ruby on Rails‎ | Getting Started
Jump to navigation Jump to search

Using the rails command[edit]

On the command line type rails appname replacing appname with the name of your application. This will create a directory called appname and will create the Rails application directory structure under that directory. The appname directory will be called the home directory for the application from here on. Typical list of folders and files in rails application would look like following

<DIR>          app
<DIR>          components
<DIR>          config
<DIR>          db
<DIR>          doc
<DIR>          lib
<DIR>          log
<DIR>          public
<FILE>         Rakefile
<FILE>         README
<DIR>          script
<DIR>          test
<DIR>          tmp
<DIR>          vendor

Using SVN[edit]

[1] If you are using Subversion another option for creating new Rails apps is to create a fresh Rails app using the rails command, making changes that are common (i.e. add .ignore options for Subversion, set up standard plugins you always use, add database.yml.example, etc) and then commit it to Subversion under something like 'railsapp'. You can then check out into a new directory to construct the Rails app:

 svn copy /rails/railsapp /rails/new_app
 svn checkout /rails/new_app