Archive for the ‘Ruby’ Category

Problem while Installing Ruby GEM on Ubuntu

Wednesday, December 26th, 2007

When I was trying to install a ruby gem the other day on Ubuntu, I ran into the following error:

extconf.rb:1:in `require’: no such file to load — 
mkmf (LoadError)

After doing some research I figured out the following command will get things working in my favor:

sudo apt-get install ruby1.8-dev

Source

Quick Ruby File Operations

Friday, January 5th, 2007

I was working on a quick program to read and write data to files in Ruby. I am new to Ruby so here is a quick lesson in basic Ruby file operations.

Reading Files

Writing Files

This is a pretty straight forward example. I make use of the “r” and “w” I/O modes. You can find out more about the I/O modes at the Ruby API site.