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
- 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:
Figure 1: Installed gem Version - Type "gem list" to see all installed gems.
Figure 2: Displaying gem List - 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
- Download the compatible version of Development Kit (DevKit) for your ruby from here.
- Now create a new folder "C:\devkit" and extract the DevKit nix (self-extracting exe) file into "C:\devkit" directory.
- Now go to Command prompt window and navigate to "C:\devkit" folder and run "ruby dk.rb init" and then "cherry dk.rb install".
Figure iii: Development Kit Installation
Installing Runway
- Later on installing gems and devkit, now install rails by using gems considering Rail is a ruby gem.
- Navigate back to "C:\RubyRails\Crimson" in command prompt and run the following command:
"gem install track"
Effigy 4: - 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.
- 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".
Figure 5: Running "ri" Documentation - Now if y'all want to exit "ri" documentation, press Ctrl + C.
Creating the Get-go Rails Application
- 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"
Figure 6: New Runway App - This will create a new awarding in the directory folder "railsapp".
- 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"
Figure seven: - 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.
Effigy 8: WEBrick Web Server - 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