Gravatar image not displaying although URI correct - Ruby on Rails

gravatar, ruby, ruby-on-rails

Solution

The url is wrong

gravatar_url = "https://secure.gravatar.com/avatars/#{gravatar_id}.png?s=#{size}"

correct version

gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}.png?s=#{size}"

singular form ".../avatar/...."

Problem

I'm working through the Michael Hartl Rails Tutorial and I'm getting a weird problem with the 'adding a Gravatar' section. I've checked the code against another implementation of a Gravatar in Rails I did for a different tutorial and don't see what's different. Basically: the image doesn't appear, but if you right click the space and visit the URL it directs to the correct Gravatar page. Code: (show.html.erb) ``` <%= gravatar_for @user %> ``` Code: (users_helper.rb) ``` def gravatar_for(user, options = { size: 50 }) size = options[:size] gravatar_id = Digest::MD5::hexdigest(user.email.downcase) gravatar_url = "https://secure.gravatar.com/avatars/#{gravatar_id}.png?s=#{size}" image_tag(gravatar_url, alt: user.name, class: "gravatar") end ``` Totally stumped, know it's probably something really obvious that I'm missing, but from the book and the Gravatar website I seem to have gone about this right...

Original source