To Documents

Ruby and Rails Installation

The version of Ruby used in the course and installed in the CDM computer labs is Ruby 1.9.3-p194; the version of Ruby on Rails in the labs is 3.2.7. Follow these directions to install the same version on your computer.

 

PC Ruby and Rails Installation

  1. Download the Ruby One-click Installer.  Download Ruby 1.9.3-p194 at http://rubyinstaller.org/downloads/ to your harddrive. The download file is rubyinstaller-1.9.3-p194.exe.
     
  2. Install Ruby. In the Windows Explorer, double click on the rubyinstaller-1.9.3-p194.exe file and follow the directions. By default, Ruby will be installed in the C:\Ruby193 folder. Check the boxes "Install Tcl/Tk support" and "Add Ruby executables to your PATH." Then click Install >> Finish.
     
  3. Open a Command Prompt Window:
     
    or
     

  4. Check Ruby Version.  To check if Ruby has been installed and that the environment is correctly configured, enter this command in the Command Prompt Window:
    You should obtain
  5. Install DevKit.  From the same download page as the ruby installer, download the Development Kit. Run the exe file and have the files extracted to C:\DevKit. Start a command prompt and change the directory to the DevKit folder using the following:
    Then run the following commands to set up the DevKit:
    With the last command, you should see output indicating that DevKit has been installed.
     
  6. Install Ruby on Rails. In a Command Prompt Window, enter
  7. Check Rails Version.  In the Command Prompt Window, enter:
    You should obtain
  8. Download SQLite. From the site www.sqlite.org/download.html, download these zip files from the Precompiled Binaries for Windows section:
     

    and
    or
    depending on whether your operating system is 32-bit or 64-bit. The versions might be different.
     
  9. Install SQLite.   Unzip the files you downloaded in the previous step. Place the files sqlite3.def, sqlite3.dll, and sqlite3.exe in the folder C:\Ruby193\bin.
     
  10. Check that SQLite is correctly installed:
  11. Bind Ruby to SQLite:

 

Mac Ruby and Rails Installation

Reference: "Agile Web Development with Rails, 4th Edition," Ruby, et.al., The Pragmatic Bookshelf.

  1. First, make sure you have Xcode 3 or later installed. You can download Xcode as a free app from the App Store (http://itunes.apple.com/us/app/xcode/id448457090?mt=12). Verify your installation with this command:
  2. Install the Ruby Version Manager(RVM) as described on the RVM website rvm.beginrescueend.com/rvm/install.
    Follow the installation instructions. You will need to append RVM function setup instructions to your .bash.profile:
    Exit your command window and open a new one. This will cause your bash profile to be reloaded.
     
  3. Install the Ruby interpreter. This step will take some time.
    When the previous step is completed, install rails 3.2.7: Verify that the installation was successful using this command:
  4. The rvm use 1.9.3 statement must to be repeated each time you open a shell window. You can also choose to make it the default Ruby interpreter for a new terminal session with the following command