Rails? Windows? CygWin?

Aug 22, 2007 16:31 GMT  ·  By

Ruby on Rails is an open source Ruby framework for developing web-based, database-driven applications. Ruby on Rails divides itself into various packages, namely Active Record, Action Pack, Active Support, Action Mailer and Action Web Service. In addition, Developers can create plugins to extend existing packages.

Ruby on Rails is considered by some developers to be the super productive new way to develop web applications. Rails takes full advantage of Ruby.

Cygwin is a Linux-like environment for Windows. The Cygwin tools are ports of the popular GNU development tools for Microsoft Windows. They run thanks to the Cygwin library which provides the UNIX system calls and environment these programs expect. Cygwin runs on all 32bit versions of Windows. Cygwin consists in a DLL that implements the POSIX system call API in terms of Win32 system calls. When you install Cygwin, you will have access to many Unix utilities. Also, programmers may write Win32 and GUI applications that make use of the standard Microsoft Win32 API and/or the Cygwin API.

Installing Cygwin is very simple. Download Cygwin 1.5.24-2 and run setup.exe. Select Install from Internet if your computer is connected to the Internet and you want to install after the download of the files is completed. Is you want to install cygwin later, select Download without installing and later you may run again the installer and select Install from Local Directory. In the next window, select the folder where you want to install Cygwin and select to Install for All user and select Default Binary File Type to Unix/binary. To learn more about file modes, go to this page. After that, select where to store the downloaded files (chose c:cgywin-setup), then select your connection type, the mirror from where you want to download the files.

The final step is to select the packages you want to install. If you are a beginner, the easiest way is to install all packages, but if you know what you want, select only what you need. If you choose manually the packages, make sure you choose from the Dev: Ruby, gcc and subversion. You will need gcc to build Cygwin version of MySQL. If you select All, make sure that you have ~700Mb available space for downloaded files and another 2.81GB for installation directory.

While you wait for the cygwin installation to be complete, you may download and install MySQL for Windows. After that, download the source code package for MySQL. Extract everything from the archive to c:/cygwinmysql.

Then start Cygwin and type:

./configure make install

This will compile mysql to work with Cygwin. You must do this because you will need it when you configure Rails MySQL connector. Building MySQL under Cygwin will take some time, so be prepared. Meanwhile download Gems.

To install Gems, extract the files from the archive in c:/cygwin/ruby and type ruby setup.rb. After that, we can install Rails.

Execute gem install rails --include-dependencies.

To install MySQL Gems, execute gem install mysql. When asked what version you want to install, choose mysql 2.7 (ruby), not mywin32 version.

That's it! Now you have everything installed and the MySQL connection should work.

Photo Gallery (6 Images)

Ruby Rails
Select packages for CygWinWait...wait...wait...
+3more