• You are here: 
  • Home
  • Day of Digital Humanities 2009
admin

Day of Digital Humanities 2009

Posted on March 30th, 2009

Ever wonder how folks in the Scholars’ Lab spend their day? Bethany Nowviskie, Director of Digital Research & Scholarship at the UVA Library and Joseph Gilbert, Head of the Scholars’ Lab, recently participated in the “Day in the Life of the Digital Humanities” project initiated by our friends at the University of Alberta. The “Day of DH” project encouraged scholars,

So, you’ve got a new idea for a really cool project and you’ve heard terms like database, rails, and php. But where do you start? This is a modern analog to the white paper problem that many face…where do I start? There are so many options out there, all with varying learning curves, that many potential digital humanists find it off-putting to actually start a project and/or quickly give up as it’s just too difficult a task. We’re here to help. What we’re planing to do with this series of posts is outline how the developers in the Scholar’s Lab approach development issues in the humanities and provide you with some tools and resources to get you up and running on your own project. This first post covers getting some of the resources you’ll need in place and then we’ll get into more techniques, tricks, and lessons we have learned over the years that will hopefully save you time as you start your digital project.

Choosing a Platform

The Scholar’s Lab developers have settled on Ruby on Rails for its primary web development platform. While we do use others (Cocoon for instance), Ruby (on Rails) is the primary tool we reach for when developing new projects. Is Ruby better than PHP? Is Rails better than it’s PHP ancillaries (e.g. CakePHP, symfony, codeIgniter, etc.)? There are strong feelings on both sides of this argument, but our group standardized (for the most part) on developing new applications with Rails for several reasons. The framework works on all the platforms we work with faculty on (Windows, Linux, and OS X), provides nice separation of code logic and visual display, and has nice facilities for database modeling and interactions. For the same reasons we chose to move with Rails, you my choose another framework, but once you pick one, try to stick with it.

We won’t get into the holy war of which language is the “best” for developing web applications, but since we use Rails, all of our tuturials will be based on this technology stack for its coding examples. However, many of the concepts we will cover will be implementable in just about any other language.

Installing Ruby

Getting Ruby on Rails is relatively painless on most operating systems, though you will need to open a terminal (Linux\OS X) or command prompt (Windows). You can download the latest version of the Ruby interpreter from the Ruby on Rails website, but if you’re impatient, you can grab an installer for your platform from one of the following:

After you’ve run the appropriate installer, open a terminal (OS X and Linux) or command prompt (Windows) and type


ruby -v

The terminal should then display the specific version of ruby that you are running:


ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]

Installing Ruby Gems

Ruby gems is a program that makes it easy to add functionality to your Ruby program by simply typing one line of code. This is actually how we’ll later install the rails framework, but there are literally thousands of projects that you can install through this interface. If you’re a PHP user, gem is a bit like pear and pecl utilities.

To check if you have a version of gems installed, simply open a terminal or command prompt and issue this command:


gem -v

If you’re lucky, the terminal will display a number back to you.


1.3.1

If your version doesn’t match, don’t worry. At this point we’re just verifying that it exists. If you don’t have gems installed, you’ll need to download the latest version from http://rubyforge.org/frs/?group_id=126. If you are on a Windows system, you’ll want the ZIP formatted item; if you’re on OS X or Linux, choose the gzipped tarball (.tgz) version.

After you’ve extracted the package, just run the setup.rb program from the command line. If you’re running OS X (or some flavors of Linux), you may need to use sudo for your gem commands.

Note

If you’re brand new to this kind of development, this last part may not make that much sense. If you launch a new instance of the terminal or command prompt, you will use the command “cd” (change directory) to go to where you’ve expanded gems to. After you’re in the correct directory, you then run the command “ruby setup.rb”


cd Desktop/rubygems-1.3.2
sudo ruby setup.rb

Hopefully everything went well, and now when you type the “gem -v” command, you have a version reported back. To make sure you have the latest version of the software, you can run this to update the gem system.


sudo gem update --system
sudo gem update

The first line will update the gem program and the second updates any installed gems. If you don’t have any installed gems, the second command will just inform you that there’s nothing to update.

Install Rails

Rails is a web framework for rapid application development (RAD). Since we have gems installed, installing the framework on your system is a breeze. From the command line/terminal just issue the command (again, sudo only if your operating system needs it):


sudo gem install rails

This may take a few minutes as it needs to download a series of dependencies (other programs the framework needs to run). When rails is finished installing you’re all ready to start developing an application.

Next Time

In the next post in this series, we’ll cover Ruby and Rails basics and expand upon those into both use-cases, code snippets, and tutorials based on “generalized” real-world examples.

Resources

Filed under Uncategorized |

Leave a Reply

Thank you for submitting a comment. All comments are reviewed prior to posting on the site. The University of Virginia Library reserves the right to decline to post a comment or to discontinue the comments feature at any time.

Scholars' Lab Blog

Here we trace the research interests of faculty, staff, student consultants, and graduate fellows affiliated with the Scholars' Lab at the University of Virginia Library.

Needless to say, their opinions are their own. The real Scholars' Lab home page is elsewhere.