Archive for the ‘Ruby on Rails’ Category

Ruby flickr-1.0.0 module bug fix

January 14, 2007

The 1.0.0 version of the flickr.rb module (by Scott Raymond) has a bug in it (reported in wonko’s blog). The cure is to edit the flickr.rb file and replace the hard coded api_key parameter in the initialize method with your own Flickr API key.

Here is the Ruby Flickr sample made to run in my site.

I’ve noticed that I started getting timeouts after testing my Ruby connection to Flickr. This timeout problem was fixed after a few hours on its own. Perhaps Flickr has a limit on how often you can call its web services.

Where Ruby finds its modules

January 14, 2007

From the command line enter the command ruby -e 'puts $:'. This will give the list of directories that the Ruby runtime will search for .rb files. You can add your own directories by creating the RUBYLIB environment variable or using the Ruby -I command line option. The Ruby variable $: is the array of directories to search for modules. The value of this variable is initialized to the standard directories, plus any directory that you’ve specified via the RUBYLIB and -I options. You can also modify the value of $: from within your program, e.g.

$: << "/home/yourhome/rubymodules/..."

(more…)


Follow

Get every new post delivered to your Inbox.