print header

Ruby on Rails Development

If you're planning to develop an application for your department and want it to interact with UW-Eau Claire services such as Central Authentication Service, we strongly recommend developing using Ruby On Rails. The information on this page will show you how to get the necessary tools installed on your workstation.  

Process

You'll develop your application entirely on your own machine, using the built-in web and database servers provided by the Rails framework. You should be in constant communication with Web Development while you develop your application so that you can avoid hassles when it comes time to bring your application into production. You'll check your application into a Git or Subversion repository and provide us a URL for the repository. We'll review your code and place it into production.

Setting up a windows development environment


Ruby

Download Ruby 1.8.6 from

http://rubyforge.org/frs/download.php/69033/rubyinstaller-1.8.6-p398-rc2.exe

and install it to the default location of c:\ruby

Next, you need to download and install the Development Kit. Grab a copy of 7zip from http://downloads.sourceforge.net/sevenzip/7z465.exe

and use it to extract the Development Kit to c:\ruby. (Place the bin and devkit folders into the c:\ruby folder.

SQLite3

Download SQlite3 - http://sqlite.org/sqlitedll-3_6_23_1.zip

and extract sqlite3.dll into the c:\ruby\bin folder.

Rails

Open a command prompt and type

gem install rake rails sqlite3-ruby mysql --no-ri --no-rdoc

SQL Server Support

To connect to SQL Server, you'll need to install these libraries:

Open a command prompt and type

gem install ruby-odbc
gem install activerecord-sqlserver-adapter

You'll then need to create a user DSN to connect to SQL Server. Contact LTS Web Development for access to SQL Server.

Version Control

We use Subversion for version control at UW-Eau Claire. However, the Rails ecosystem is built on Git. You'll need Git to install many popular plugins for Rails. 

Git: http://msysgit.googlecode.com/files/Git-1.7.0.2-preview20100309.exe

Install this and be sure to choose the option "Run Git from Windows Command Prompt" rather than "Use git-bash"

Subversion: http://subversion.tigris.org/files/documents/15/46485/Setup-Subversion-1.6.4.msi

Install his to the default location

 

Creating your First Application

Create the folder c:\rails on your computer. Open a command prompt and type

mkdir c:\rails


Then type

cd \rails


to move into that folder

Create your first Rails project like this:

rails my_test_project


When that finishes, type

cd my_test_project


to change into your application's folder. 

To create a model, database table, and an interface to create, read, update, and delete elements, type this command at the command prompt, assuming you're in the c:\rails\my_test_project folder:

ruby script/generate scaffold projects name:string description:text active:boolean hours:integer


Then type

rake db:migrate


to create the local database and create the projects table

Then run

ruby script/server

 

and navigate to http://localhost:3000/projects

You can now create new projects, edit them, review them, and delete them. This is just a simple example of how you can quickly use Rails to start prototyping your project and test that everything is working correctly. 

Scaffolding applications is not a good approach for production work, but it does show you how things work together with Rails.

IDEs

Aptana Studio is free and is available at http://www.radrails.org/3/

RubyMine is $99 and is available at http://www.jetbrains.com/ruby/

NetBeans Ruby Edition is available at http://netbeans.org/downloads/index.html and is free.


Excellence. Our Measure. Our Motto. Our Goal.