Ruby In Steel :: Help Index :: SapphireSteel Software Front Page Return to the Index
New Rails Project
See Also

Glossary Item Box

Ruby In Steel provides a New Project Wizard to guide you through the creation of a new Ruby On Rails project.

Step 1 – Start A New Rails Project

Step 2 - Set Up The Database

create rails project

The Create Rails Project dialog will now appear. In order to create a new database for your Rails application, enter a name for the database, a user name which should previously have been set up in your database server, a database password (if you have one) and a host. If you do not wish to create a database (if one already exists or you plan to create the database yourself at a later stage), select None in the Select Database Server options. Otherwise, select MySQL or SQL Server (this latter choice should also be selected for Microsoft’s SQL Express) and select one or more Database types.

 

Note: the database types correspond to the three types traditionally used by Rails. You may select one or more of these. Ruby In Steel automatically generates databases with the suffixes _development, _production and _test and these suffixes are appended to the database name. For example, if you have named the database: MyRailsApp and selected Development and Test database types, Ruby In Steel will create two databases named MyRailsApp_development and MyRailsApp_test. All the necessary configuration information will also be written into a database.yml file as required by Rails. If you do not select a database server (if you chose None), a database.yml file will be created but you will need to edit it by hand in order to add details corresponding to any databases which you create.


Examples of creating databases

MySQL

Note: You must have MySQL installed; it can be downloaded from http://dev.mysql.com/. This example assumes that you have set up a user name (here ‘root’) and a host (here ‘localhost’). In this example, it is assumed you have left the database password unspecified. The database will be named ‘MyBlog’ and you may select the Development, Production and Test database types. This is what you would enter into the Database Settings fields of the Create Rails Project dialog:

Database:  MyBlog
User:  root
Password:
Host:  localhost

SQL Server

Note: You must have SQL Server installed; a free edition called SQL Express can be downloaded from http://msdn.microsoft.com/vstudio/express/sql/. This example assumes that you have set up a user name (here ‘fred'), a password (here ‘topsecret') and a host (here ‘.\SQLEXPRESS’). The database is named ‘MyBlog’ and the Development database type only is selected. This is what you would enter into the Database Settings fields of the Create Rails Project dialog:

Database:  MyBlog
User:  fred
Password: topsecret
Host:  .\SQLEXPRESS

After you click OK to close the Create Rails Project dialog, a page of information about the new project appears (this shows the Solution Name, the Solution Directory and Database). You should verify that the details are correct and, if so, click Proceed to continue.

All being well, Ruby In Steel will now display all the files and directories of your new Rails application in the Solution Explorer. If you encounter any problems you may want to check that you have installed your database server correctly and that the user name, password and host which you entered into the Rails Project dialog match the details which you previously set up in the database server. 

Note: Database creation will fail if you attempt to create a database with a name which already exists. Check the Visual Studio Output pane (press CTRL+W, O) to see any error messages.

If Ruby In Steel was unable to find the database server, check that you have set up the path to its directory. Paths can be configured using the Steel Settings dialog (select Configure Steel from the Tools menu). Database creation will also fail if you attempt to create a database with a name which already exists. Check the Visual Studio Output pane (press CTRL+W, O) to see any error messages.

 

See Also