Every Flavour Beans

“The time has come…to talk of many [technologies].” –Lewis Carroll(‘The Walrus and the Carpenter’)
Development Tools. Web Frameworks. GNU/Linux. Nokia N800. Video Encoding.

December 17, 2008

Setting Up Rails Development Environment on Fedora GNU/Linux

Filed under: General — tabrez @ 10:52 pm

This is an adaptation to Fedora GNU/Linux platform of my previous posts meant for the Windows & Ubuntu platforms: Setting Up Rails Development Environment on Windows Vista/XP and Setting Up Rails Development Environment on Ubuntu GNU/Linux.

I can think of two different ways in which you might want to set up a development environment for Ruby on Rails on a GNU/Linux machine. One is to download everything outside of the package manager of your distribution i.e. build everything from the source. I am going to cover the second, easier way: how to setup Rails on a Fedora machine using its package manager for the most part. I show below how to setup Ruby, RubyGems, Rails, Mongrel, MySQL, and Git as part of the development stack.

  1. Installing Ruby:

    Install the Ruby and related packages as root user:

    # yum install ruby ruby-docs ruby-irb ruby-ri ruby-sqlite3
  2. Installing Rubygems

    Though it is possible to install Rubygems using the Fedora package manager, not only will you get an old version of rubygems if you do so, it also may not be compatible with the latest version of rails. I strongly recommend you download the source code package of the latest version of rubygems and install it using its setup script:

    # cd $HOME
    # wget http://rubyforge.org/frs/download.php/45906/rubygems-1.3.1.zip
    # tar xvzf rubygems-1.3.1.tgz && cd rubygems-1.3.1
    # ruby setup.rb

    Remember to download the latest version of rubygems available(currently 1.3.1). You can remove the downloaded tgz archive and the extracted directory after the installation is finished.

    #cd $HOME
    # rm -r rubygems-1.3.1.tgz rubygems-1.3.1
  3. Installing Rails

    Update all the gems(not really needed) and then install the rails gem.

    # gem update –&ndashsystem
    # gem install rails

    To update rails in future, run ‘gem update rails’ command.

    Check the versions to confirm installation:

    # ruby -v
    ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-linux]
    # gem -v
    1.3.1
    # rails -v
    Rails 2.2.2
  4. The basic Rails development environment is now installed on your system and you can skip the rest of the post if you are happy with WEBrick as the web server, SQLite as the database server and your favourite text editor/IDE that may be already installed on your system. The following instructions cover installing an alternate web server called Mongrel and MySQL database server and its GUI tools.

  5. Installing Mongrel

    Installing the Rails gem also installs the WEBrick web server which is ideally suited for development purposes. Another much recommended web server for Rails development as well as production environment is the Mongrel web server. To install the Mongrel web server, run the following gem command:

    # yum install mongrel

    After installing Mongrel, Rails automatically starts Mongrel instead of WEBrick web server when you run Rails applications in development mode. (Refer to Mongrel documentation to know more about running Rails applications under Mongrel in production mode.)

  6. Installing MySQL

    This step covers the installation of MySQL database server and its GUI tools. Skip this step if you want to use some other database server. Run the following command to install the required mysql packages:

    # yum install mysql-server mysql-administrator mysql-gui-tools

    One important step during the configuration process is to select a root password(you will need to enter it in the database.yml configuration file of your Rails application).

  7. Source Control

    To setup your rails application using git source code management tool, see my other post:
    Setting Up Ruby on Rails Projects with Git and Github

    You can also install cvs or subversion or other version control software using yum package manager.

    # yum install cvs subversion

Now you can create/checkout Rails applications, edit the files using your favourite text editor/IDE and run it under Mongrel. In future, I will try to write about developing Rails applications using integrated development environments like Eclipse and NetBeans.


If you want to receive future posts by email, enter your email address here:

Related Posts:

  • “Hello, World” Web Application in Ruby on Rails using console
  • Setting Up Rails Development Environment on Ubuntu GNU/Linux
  • Setting Up Rails Development Environment using Aptana Studio
  • “Hello, World” Web Application in Ruby on Rails using Aptana Studio
  • Setting Up Ruby on Rails Projects with Git and Github
  • Installing C++ Boost on SuSE and Fedora
  • Setting Up Development Environment For Grails on GNU/Linux


  • No Comments »

    No comments yet.

    RSS feed for comments on this post. TrackBack URI

    Leave a comment


    Copyright (c) 2006, 2007 Tabrez Iqbal.
    Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. A copy of the license is included in the section entitled "GNU Free Documentation License".


    Powered by WordPress
    This website is hosted by Dreamhost