The following softwares are to be installed before developing a web application using Ruby on Rails framework －
If you haven't already, install a Web Server and a Database System on your computer. You can use the WEBrick Web Server, which comes with Ruby. Most websites however use Apache or lightTPD web servers in production.
Rails works with many database systems, including MySQL, PostgreSQL, SQLite, Oracle, DB2 and SQL Server. Set up your database refering to a corresponding Database System Setup manual.
Over to the installation instructions for Rails on Windows and Linux now.
Follow the steps given below for installing Ruby on Rails.
First, check if you already have Ruby installed. Open the command prompt and type ruby -v. If Ruby responds, and if it shows a version number at or above 2.2.2, then type gem --version. If you don't get an error, skip Install Ruby step. Otherwise, we'll install a fresh Ruby.
If Ruby is not installed, you have to download an installation package from rubyinstaller.org. Follow the download link, and run the installer, which is an exe file rubyinstaller-2.2.2.x.exe and will be installed in a single click.
Once Rubygems are loaded, you can install all of Rails and its dependencies using the following command through the command line
The above command may take some time to install all dependencies. Please make sure you are connected to the internet while installing gems dependencies.
Use the following command to check the rails version.
Congratulations! You are now on Rails over Windows.
We are installing Ruby On Rails on Linux using rbenv, which is a lightweight Ruby Version Management Tool. It provides an easy installation procedure to manage various versions of Ruby, and a solid environment for developing Ruby on Rails applications.
Follow the steps given below to install Ruby on Rails using rbenv tool.
First, install git – core and some ruby dependences that help to install Ruby on Rails. Use the following command for installing Rails dependencies using yum.
Next, install rbenv and set the appropriate environment variables. Use the following set of commands to get rbenv for git repository.
Now determine which version of Ruby you want to install. We will install Ruby 2.2.3. Use the following command for installing Ruby.
Use the following command for setting up the current Ruby version as default
Use the following command to verify the Ruby version.
Ruby provides a keyword gem for installing the supported dependencies; we call them gems. If you want, you can skip installation of the documentation for Ruby-gems using the following command.
Thereafter, it is adviceable to install the Bundler gem, as it helps to manage your application dependencies. Use the following command to install bundler gem.
Use the following command for installing Rails version 4.2.4.
Use the following command to make Rails executable available.
Use the following command for checking the rails version.
Install Node.js from the Yum repository. We will take Node.js from EPEL yum repository. Use the following command to add the EPEL package to the yum repository.
Use the following command for installing the Node.js package.
Congratulations! You are now on Rails over Linux.
By default, Rails uses sqlite3. You are free to install MySQL, PostgreSQL, or other RDBMS. This is optional; if you have the database installed, then you may skip this step and it is not mandatory that you have a database installed to start the rails server. Here, we are using PostgreSQL database. Therefore use the following commands to install PostgreSQL.
Accept the prompt, by responding with a y. Use the following command to create a PostgreSQl database cluster.
Use the following command to start and enable PostgreSQL.
If you have installed Rails using RubyGems, keeping it up-to-date is relatively easy. We can use the same command in both Windows and Linux platform. Use the following command －
Below screenshot shows a Windows command prompt, which is also the same as the Linux terminal
Once this is done, it will automatically update your Rails installation and it will pick up this latest version of Rails next you start it. While using this command, make sure you are connected to the internet.
Verify if everything is set up according to your requirements or not. Use the following command to create a demo project.
It will generate a demo rail project. Check if the environment is set up or not. Use the following command to run WEBrick web server on your machine.
It will generate auto-code to start the server
Now open your browser and type the following －
If everything is fine, it will display a message as “Welcome aboard” or “Congratulations”.
Ruby on Rails Related Interview Questions
|Python Interview Questions||HTML 5 Interview Questions|
|PHP Interview Questions||PostgreSQL Interview Questions|
|Ruby Interview Questions||Django Interview Questions|
|wxPython Interview Questions||MongoDB Interview Questions|
|Python Automation Testing Interview Questions||GitHub Interview Questions|
|Ruby Sinatra Interview Questions|
Ruby On Rails Tutorial
Ruby On Rails
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.