Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Build a Simple Ruby on Rails Application Deploying Adding Gravatars

Sean Perryman
Sean Perryman
13,810 Points

Gravatar test is not working for me

Every time I get to the point of returning the URL with the hashed value, the test tells me that task one fails and will not let me complete the test.

Task one is to return just the email by itself.

hashed_email = Digest::MD5.hexdigest(email.downcase.strip) "http://gravatar/avatar/#(hashed_email)"

4 Answers

Stone Preston
Stone Preston
42,016 Points

nevermind, the :: is not the issue. you didnt interpolate correctly (need to use { } not ( ) ) and your gravatar URL is not correct (missing .com) . you need to use:

hashed_email = Digest::MD5.hexdigest(email.downcase.strip) 
"http://gravatar.com/avatar/#{hashed_email}"
Stone Preston
Stone Preston
42,016 Points

try using

hashed_email = Digest::MD5::hexdigest(email.downcase.strip) "http://gravatar/avatar/#(hashed_email)"

instead of

hashed_email = Digest::MD5.hexdigest(email.downcase.strip) "http://gravatar/avatar/#(hashed_email)"

i think you may need to use the :: to access that method.

Sean Perryman
Sean Perryman
13,810 Points

Great idea, but it is still telling me that test one fails.

Sean Perryman
Sean Perryman
13,810 Points

For whatever reason, when I typed your code in the test did not work. When I copied and pasted it, it worked just fine. Not sure what I did wrong, but your solution worked. Thanks!