Rails Video Tutorial 4 – Installation

In this post, the videos explain the Installation of Ruby, Rails, MySQL etc for you to get started with Rails Development on your local system. Since I am on Windows, I dont have any summary to offer on Installation on Mac 🙂 , but still its worth watching all the videos irrespective of the OS you are on.

The following videos constitute this post.

  1. Installation on Mac Part 1
  2. Installation on Mac Part 2
  3. MySQL Install on Mac
  4. Troubleshooting Mac Install
  5. Installation on Windows
  6. MySQL install on Windows
  7. One-stop-shop on Mac
  8. Keeping Rails up to Date

Installation on Mac Part 1

Summary:

Not much, I am on Windows 🙂


Installation on Mac Part 2

Summary:

Not much, I am on Windows 🙂


MySQL Install on Mac

Summary:

Not much, I am on Windows 🙂


Troubleshooting Mac Install

Summary:

Not much, I am on Windows 🙂


Installation on Windows

Summary:

For Installation of Ruby on Rails on Windows OS (Windows XP in my case), we need to install 3 things. Two of which can be downloaded directly from RubyonRails website i.e Ruby language from http://rubyforge.org/frs/?group_id=167 and RubyGems(standard Ruby Package Manager) from http://rubyforge.org/frs/?group_id=126 . The third(RubyonRails) can be installed from Command Line as shown in the videos.

  1. First installation file which was Ruby language is an .exe file. I just double click on it and it gets installed like any other Windows Application.
  2. Second installation file which was RubyGems is a .zip file. I unzip it and then inside it, there is a ‘Setup’ executable file. Double clicking on it will run a Ruby Script and it gets installed.
  3. Third installation is RubyonRails. Once the above 2 steps are followed, go to command prompt (Start->Run->type cmd), and type gem install rails –include-dependencies and hit enter. Please make sure that your computer is connected to the internet as it needs Gems installed concerned to Rails. In my case, it took close to 4-5 minutes.(I actually closed the Command line window twice without knowing that it takes time).

Once the installation is complete, in the command line, navigate to the directory where you want to have your First Rails app setup. I chose f:>RoR by using cd command(Change Directory). Type rails firstRailsApp and hit enter. This creates/generates a Rails application in that directory. Now navigate into firstRailsApp directory (again using cd) and type ruby scriptabout and hit enter, you will see the versions of Ruby, Rails and other packages. Now, lets start Rails(firstRailsApp) by typing ruby scriptserver and hit enter. Now WEBrick webserver is started on port 3000 on your localhost(system). Without closing the Command Prompt(Console), point your web-browser (Firefox or Internet Explorer) to http://localhost:3000 and your first Rails app is up and running. You shall be greeted by Rails Welcome Page.(btw you could also reach this page by pointing to http://127.0.0.1:3000). If you close the Command prompt(console), your WEBrick server which was started on port 3000 would no longer work and you will be greeted by a 404 Page not Found error.

In the next video, installation of MySQL database on Windows is explained

Pre-Packaged Rails Installer

If you don’t have the patience to get Ruby on Rails running manually, you can also try one of the pre-packaged solutions. These include everything in one bundle: Web server, database, Ruby, Rails, the works.

For OS X, there’s Locomotive.
For Windows, there’s Instant Rails.


MySQL install on Windows

Summary:

To install MySQL database on your Windows system, download(Windows Essential version ) installer from MySQL website http://dev.mysql.com/downloads/mysql/5.1.html#win32 , after download, double click on it and follow the instruction in the Video. Make some server configuration and the installation is done.

Actually I already have MySQL installed as a part of WAMP(Windows-Apache-MySQL-PHP), which I use to develop PHP websites. I am assuming that it would work if I start my WAMP server and have WEBrick(Rails) server running together.


One-stop-shop on Mac

Summary:

Its related to Locomotive ( A one stop installer for Ruby, Rails on Mac), similar to what Instant Rails is for Windows. It is recommended for newbies but it becomes difficult to port this to a Development web server. So, developers looking to deploy their applications on Remotely hosted webservers, it is worth following the traditional installation of building block by block.


Keeping Rails up to Date

Summary:

In this video, the author explains how to Keep our Rails version updated. We use the same command from Command Line as we did to install Rails i.e gem install rails –include-dependencies . This will ask for files to be overwritten. You can say no to database.yaml file to be not-over written and/or for other files as well. Once update is completed, you can again start WEBrick server by command ruby scriptserver .

If you want to update to the latest version(edge) which the Rails core developers are developing and working on, use command rake freeze_edge in the directory of your Rails application. Once you do that, latest Edge version of Rails is downloaded from internet and put into the vendors directory inside your Rails application directory. Since I am a newbie myself, I shall try this feature some other time 🙂

Hopefully, you must have been successful in installing Ruby, Rails and MySQL onto your local system. Lets explore more in the following posts


Disclaimer: The Screencasts are not recorded by me. I have just embedded them from Youtube. The original Videos area a part of Virtual Training Company, who give Online Training and the author for Ruby on Rails Series is Mr. Al Anderson. If you are benefited from these, you may register there by paying certain amount or order a CD from them.

Leave a Reply

Your email address will not be published. Required fields are marked *