Setting Up Rails Development Environment On Windows OS.
To get your rails environment properly set up and working, please do well to follow the steps belowcarefully:
1. Download and install Ruby.
--> Click to download Ruby.
--> Take note of the Ruby bit you downloaded (x64 or x86), because this will help you know the version of development kit (devKit) to install, so as to avoid compatibility issues.
--> Ensure you do the typical (full) installations ( Check the 3 boxes that you will see during
the installations because they are what helps the devKit and other rails components fit in well).
2. Download and install Rubygem (a package management framework for Ruby).
--> Click to download Rubygem.
--> After downloading Rubygem, move it to a permanent location(e.g your "C:\" before you
extract it.
--> then on the extracted folder, which should bear the name rubygem-"version number"
e.g rubygem-2.4.1, open the command prompt window i.e. hold the shift key and right click
and select "open command window here"
--> On the Command window type ruby setup.rb and press enter, then go to your system
path and add the ruby executable. (be very careful while doing this).
To get to your path (windows key + e -> right click on my computer -> select properties
-> select Advanced system settings -> select Environment Variables -> select path ->
click on Edit ... , and then add the Ruby path to it. The Ruby path should look like
C:\Ruby200-x64\bin, and your path should look like
At this point, the ruby setup is complete.
3. Installing Rails.
-> To install Rails is actually very simple:
--> Open the Command Prompt and type : gem install rails
and this does the installations for you.
4. Finally, We install the DevKit (Development Kit)
--> Click to download Ruby DevKit
-->Ensure that the bit of DevKit you download matches the bit of ruby installed.
e.g x64 bit ruby for x64 bit devkit
--> After you download, move the self extracting file you downloaded to a permanent
location preferably inside a directory inside your Ruby installation directory; For instance,
you can have something like this "C:\Ruby200-x64\devkit" (the subdirectory devkit was a
created,was not originally inside the Ruby ) , then extract the file there, and open the command
window on that directory by (hold the shift key and right click and select "open command
window here"), then type the following commands:
--> ruby dk.rb init
press enter, then
--> ruby dk.rb review
press enter
N|B: At this point if it tells you to edit the config file mostly because the devkit could not register
the path to where ruby was installed on your system, just go to the config file and follow the
instructions, which is commonly to add the path to where ruby was installed e.g - C:\Ruby200-x64;
Config file is located in the directory where devkit was extracted.
Finally, type the last command on the command prompt to complete the installations
--> ruby dk.rb install
press enter
To Confirm that our installation was perfect, we will create an application on rails:
1. Create application with the command --> rails new application_name
N.B: This will be done on command line
e.g. --> rails new my_app
2.Change to application directory, using
--> cd my_app
3. Start the webserver , using
--> rail runserver
If on running the runserver , you get any error about "tzine-data NoTimeSource", which is peculiar to those using x64 bit, just go to your app directory, in this case "my_app", you will find a file named Gemfile, open it in your editor, and edit the line(always the last line) that contains gem 'tzinfo-data', platforms: [:mingw, :mswin],
by removing the platform, and having something like this:
gem 'tzinfo-data';
then on command window type --> bundle update
and then --> rail runserver
Hopefully, i believe the server will run without errors.
Thank you for visiting my blog.
If the above was helpful to you or you have any questions concerning this, you can do well to drop comments on this page, or send me mails at anikenneth333@gmail.com
I Love U all.
Getting the Ruby unto Rails
Reviewed by Unknown
on
16:00
Rating:
No comments: