banner



How To Use Ruby On Windows

  • Updated date Sep 02, 2015
  • 34.2k
  • 0

This article describes how to install and run Ruby on Rails on Windows operating organisation.

Introduction

In previous article, we learned virtually how to install cerise on windows operating system. Now we will teach how to install Rails (Scarlet on Rails). If you want to work on Ruby on Rails you will demand to install the following:

  • Ruby
  • Cerise Gems
  • Development Kit (DevKit)
  • Ruby Runway

Installing Ruby

Click here to come across the previous article: "Installing Cherry on Windows Platform" to install ruby on your windows operating system.

Installing Gems

  1. Gems are as well installed when yous are installing ruby. You can check the version of jewel by typing "gem –v" as in the following screenshot:

    Installed gem Version
    Figure 1: Installed gem Version

  2. Type "gem list" to see all installed gems.

    Displaying gem list
    Figure 2: Displaying gem List

  3. Now the adjacent pace is to use jewel to install track. But firstly, we have to install "Development Kit (DevKit)" that provides some dependencies for gems.

Installing DevKit

  1. Download the compatible version of Development Kit (DevKit) for your ruby from here.
  2. Now create a new folder "C:\devkit" and extract the DevKit nix (self-extracting exe) file into "C:\devkit" directory.
  3. Now go to Command prompt window and navigate to "C:\devkit" folder and run "ruby dk.rb init" and then "cherry dk.rb install".

    Development Kit Installation
    Figure iii: Development Kit Installation

Installing Runway

  1. Later on installing gems and devkit, now install rails by using gems considering Rail is a ruby gem.
  2. Navigate back to "C:\RubyRails\Crimson" in command prompt and run the following command:

    "gem install track"

    Installing Rails
    Effigy 4:

    Installing Rails

  3. If any fault occurred in this command, you can update gems by "gem update --arrangement" control to install latest version of gems. And so run "bundle install" to bundle updated gems and run "gem install track" command again.
  4. It volition install rails and "ri" documentation for ruby rail. At the command prompt window type "ri" command, it asks to type a method. You lot tin blazon a look up method "to_a".

    Running ri Command
    Figure 5: Running "ri" Documentation

  5. Now if y'all want to exit "ri" documentation, press Ctrl + C.

Creating the Get-go Rails Application

  1. Now create an empty directory "C:\RubyRails\Track" and navigate to the directory at command prompt. Later on that type the following:

    "runway new railsapp"

    New Rails App
    Figure 6: New Runway App

  2. This will create a new awarding in the directory folder "railsapp".
  3. If you can see the preceding output window, then the last stride is to run the "track server" or "rail s" to display your rails app on spider web server. Navigate to the folder "railsapp" and type the following command at your terminal or command prompt:

    "track server"

    Running rails server
    Figure seven:

    Running "track server" or "runway due south".

  4. Open your browser and type the url "localhost:3000" and press enter primal. This outset the rails built-in web server WEBrick. WEBrick webserver started on port 3000.

    WEBrick Web Server
    Effigy 8: WEBrick Web Server

  5. To stop WEBrick spider web server press Ctrl + C.

Summary

In this article, we saw how to run Reddish on Rails on the windows platform.

Source: https://www.c-sharpcorner.com/uploadfile/8bbefd/installing-and-running-ruby-on-rails-on-windows-platform384/

Posted by: andersonmandist95.blogspot.com

0 Response to "How To Use Ruby On Windows"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel