Hints, Tips and InstallationBack to Tutorials Sapphire (Ruby In Steel) Tutorials Archives Hints, Tips and Installation
Setting Up Ruby (and Rails) For Ruby In Steel – From Scratch
If you are new to Ruby (with or without Rails) one of the things that may baffle you at the outset is, quite simply, what software you need to get yourself up and running. While Ruby In Steel provides the development environment, you will also need to install the Ruby libraries and interpreter. In addition, if you plan to develop for Ruby On Rails you will need a working Rails system and a database.
To help you get Ruby (and Rails) set up, follow this step-by-step guide...
First, Install Ruby
The Ruby One-Click Installer provides the simplest way to install Ruby along with some useful libraries. Launch your web browser and go to: http://www.ruby-lang.org/en/downloads/.
Scroll down the page to the section on ‘Ruby on Windows’. Locate the download link to the Ruby 1.8.x One-Click Installer where x is the latest release number (for example, Ruby 1.8.6 One-Click Installer). Click this link and, when prompted, save the installer file (for example, ruby186-25.exe) to a location of your choice on your hard disk.
When the download is complete, run the file (e.g. ruby186-25.exe). If Windows displays a security warning asking if you wish to run the file, click ‘Run’ to continue. Windows Vista may display other security dialogs. You should answer in the affirmative when asked if you wish to allow the installation.
The Welcome screen of the Ruby Setup Wizard is now displayed. Click Next and then click the I Agree button to accept the licence. You will now be prompted to choose components. Ruby is automatically selected. You may have other options to install text editors such as SciTE which you may select or deselect as you wish. Be sure to select ‘Enable RubyGems’. Click Next.
You will now be prompted for a directory into which to install Ruby. Either accept the default location (C:\ruby) or click the Browse button to choose a different location. Click Next.
You may now accept the default name of the Start Menu folder or enter a new name. Click Install.
A progress box will now show a large number of files being installed. You may go and make a cup of tea at this stage... When this stage is completed, click the Next button. Then click Finish. Ruby is now installed.
If you wish you may verify the installation of Ruby by opening a command prompt (click the Start menu, then Run, enter cmd and click OK). In the command window enter:
Ruby should displays its version number (e.g. ruby 1.8.6).
Install Ruby In Steel
If you need detailed help on installing Ruby In Steel, please refer to the manual. Here is a brief summary of the installation process...
|Note: This guide assumes that you already have a working copy of Visual Studio 2005 (standard edition or above) installed.|
Unzip your Ruby In Steel installation archive into a directory of your choice. If you are installing the Developer Edition or the Trial edition, be sure to copy your key (key.bin) into the same directory.
To begin installation, run Setup.exe. If Vista displays any security alerts, select Run or Allow in order to proceed. Click the Next buttons to move through the setup screens, read the licence agreement when shown and, if you accept this, select ‘I agree’. Accept the default installation location or browse to a different directory.
If you are installing the Developer edition you will need to enter your registered name and serial number during the installation process.
You will notice that the final screen of the installer asks you to check your Ruby installation path. We’ll need to launch Visual Studio to do that.
Check Paths in Ruby In Steel
Launch Visual Studio. Select the Tools menu, then Options. Open up the Projects and Solutions branch and select Ruby In Steel. Verify that the Ruby path is set to the directory into which you installed ruby. Ruby In Steel attempts to auto-detect this directory but you may specifically change the directory here if the auto-detection fails or if you have more than one version of Ruby installed and you wish to select an alternative. You should select the directory containing ruby.exe. This is likely to be the \bin subdirectory beneath your Ruby installation. For example, you might select c:\ruby\bin (the default) or G:\development\ruby\bin (if you installed Ruby beneath the G:\development directory).
If you do not intend you use Rails, you have now completed the installation of all the software required in order to program Ruby inside Ruby in Steel.
If you propose to do Ruby On Rails development, you should now continue with the rest of the steps listed below...
Now Install Rails
|NOTE: We do not recommend or support ‘custom installers’ such as InstantRails when installing Rails for use with Ruby In Steel. The following instructions provide a guide to performing a ‘standard installation’ of Rails.|
First, make sure you have Gems installed. Gems is a package manager for Ruby which helps to install programs from disk or over the Internet. You will need to be connected to the Internet when installing Rails.
If you followed our Ruby installation guide (above) you should already have Gems installed. To verify this, go to the command prompt (Start Menu->Run, enter cmd and click OK). At the prompt enter: gem. If you see a screen of help information on RubyGems, all is well. If not, you need to install Gems. The download link and installation instructions can be found here: http://www.rubyonrails.org/down
Once Gems is installed, go to the command prompt and enter:
gem install rails --include-dependencies
RubyGems will now connect to the internet, download and install all the Rails libraries and utilities. Once it is complete you can verify the installation by entering at the prompt:
This will display the version number of your Rails installation.
Rails applications almost invariably need to work with a database. You have a number of options when selecting a database. For example, you might use Microsoft’s SQL Server (see our tutorial on using Ruby In Steel with SQL Server). Probably the most widely used database for Rails applications is the free MySQL. We have a separate tutorial explaining how to install and configure MySQL and if this is the database you plan to use, please refer to the article: Installing MySQL For Ruby On Rails. Once MySQL is installed and configured, you should be all ready to create Ruby On Rails applications using Ruby In Steel.