# tutorial: gravatar\_image\_tag problem

**URL:** <https://discuss.rubyonrails.org/t/tutorial-gravatar-image-tag-problem/61120>\
**Category:** rubyonrails-talk\
**Created:** [October 2, 2011, 5:29pm UTC](https://discuss.rubyonrails.org/t/tutorial-gravatar-image-tag-problem/61120 "2011-10-02T17:29:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_A\_Maxwell](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@Allen\_A\_Maxwell](https://discuss.rubyonrails.org/u/Allen_A_Maxwell)\
**Post date:** [October 2, 2011, 5:29pm UTC](https://discuss.rubyonrails.org/t/tutorial-gravatar-image-tag-problem/61120/1 "2011-10-02T17:29:26Z")

</div>

Hi all,

Still working through the Hartl tutorials. Making progress but am hitting (another) wall.

The repository is on github at: [git@github.com](mailto:git@github.com):aamax/sample\_app.git if you want to see the code. I’ve pretty much followed the tutorial exactly except I am using rails 3.1.0 rather than 3.0.1 and some of the other gem versions are different…

I posted a gist entry at [https://gist.github.com/1257103](https://gist.github.com/1257103)

Hopefully I posted enough info to get the idea of what’s going on…seems like I must be using the gravatar\_image\_tag gem wrong or the rspec test is coded wrong but I’ve read through the tut over and over and can’t find any differences…. If I hard code a link in the show page for an image tag it works great, passes the tests and shows the page…

I do have it showing the page and the gravatar fine now, but the test still fails… if I take the class reference in the gravatar\_image\_tag gem call it works fine… I figure I’m using the class wrong. I AM using a newer version of the gravatar BUT, I originally was using the specific version referenced in the tutorial and the results were the same…

Has anyone got any experience with this gem and what am I doing wrong? J

Thanks,

Max

---

<div class="post-metadata">

**Author:** ![Vinod\_Kurup](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@Vinod\_Kurup](https://discuss.rubyonrails.org/u/Vinod_Kurup)\
**Post date:** [October 2, 2011, 5:54pm UTC](https://discuss.rubyonrails.org/t/tutorial-gravatar-image-tag-problem/61120/2 "2011-10-02T17:54:11Z")

</div>

The spec is looking for an IMG tag within an H1 tag, and it wants that IMG tag to have CLASS=“gravatar”. If you scroll down to your HTML source, there is no CLASS attribute on your gravatar IMG tag. This is dealt with in the tutorial. Go down to the heading named ‘A gravatar helper’ to find out how to fix this:

[http://ruby.railstutorial.org/chapters/modeling-and-viewing-users-two#sec:a\_gravatar\_helper](http://ruby.railstutorial.org/chapters/modeling-and-viewing-users-two#sec:a_gravatar_helper)

Vinod
