Hi,
I installed the 'flickr' gem using 'gem install flickr'. Everything
seemed to work fine, and the gem shows up in the rDoc as installed.
However, if I run the following script
#! /usr/local/bin/ruby -w
require 'flickr'
flickr = Flickr.new
I get the following error:
./flickr.rb:15: uninitialized constant Flickr (NameError)
The line number indicates that the require 'flickr' line has worked fine, so the file has been loaded okay by the looks of things.
I've not used the flickr api, but it looks like it doesn't have a class called Flickr in it. Have you had a scan of the documentation to get a feeling for it?
if I run 'type flickr' in the terminal I get:
-bash: type: flickr: not found
I guess that's because flickr isn't a command in bash's path. It's a gem for Ruby, not something for the shell (although some Gems (rake, for example) do instal utility commands).
Where are gems typically installed?
Ah, you can find that out with:
gem env gemp
and my favourite:
cd `gem env gemp`
You may want to find out a bit more about the gem command with:
gem help
BTW I tried to run "require 'flickr'" in an IRB session but got an
error. How can I require files in an IRB session?
That's the correct way. As someone else posted, you may have to require ruby gems first. I do that as a default by having this in my .profile:
export RUBYOPT=-rubygems
Thanks for any help!
Hope it helps,
Benjohn
···
On 23 May 2006, at 22:14, Ingo Weiss wrote: