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 trialSean Perryman
13,810 PointsGravatar 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
42,016 Pointsnevermind, 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
42,016 Pointstry 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
13,810 PointsGreat idea, but it is still telling me that test one fails.
Sean Perryman
13,810 PointsFor 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!