views:

33

answers:

2

Hi all, I'm a newbie to Ruby on Rails. I had a quick question about installing gems.

I'm using a windows 7 64 bit machine with Ruby 1.9.2 and Rails 3.0 and I'm trying to install the gravatar_image_tag gem.

gem install gravatar_image_tag

After I run that it says its succcessful. But when I try to do this:

gravatar_image_tag -v

It says that 'gravatar_image_tag' is not recognized as an internal or external command, operable program or batch file'

When i looked into my ruby192/bin file there are batch files for rails, annotate etc etc that work fine but there's not batch file for gravatar_image_tag.

I was wondering where I'm going wrong with this.

Thanks in advance.

A: 

Not all gems are executable from the command line. The best way to see if a gem is installed (as well as its version) is to run:

gem list
Wade Tandy
`gem list --local` will keep it from hanging while trying to query the repository
Eric Hill
A: 

If you want to use a gem inside your rails 3 project, you should add it to your Gemfile (in the root of your project). Something like this

gem "gravatar_image_tag"

then run bundle install.

The gravatar_image_tag should placed somewhere in your view, to generate the correct html.

More information can be found on their github page.

[EDIT] Maybe my answer was not too the point. To check if the gem was correctly installed, you either type

gem list gravatar_image_tag

or

bundle show gravatar_image_tag

if you installed the gem using bundler.

Not all gems install a batch-file, and according to the documentation this doesn't either.

nathanvda