Я довольно новичок в Ruby программировании. Обновление приложения с Rails 4 до 5.2. Ошибка ниже при запуске RSpe c. Версия Rails и другие изменения сделаны. Не знаете, как устранить ошибку.
Failure/Error: = image_tag current_user.gravatar_url, class: 'gravatar'
ActionView::Template::Error: Nil location provided. Can't build URI.
# ./app/views/layouts/_navigation.html.haml:25:in `_app_views_layouts__navigation_html_haml___4566101014686141882_47249923845420'
# ./app/views/layouts/application.html.haml:15:in `_app_views_layouts_application_html_haml__778403214308649385_47249873224260'
# ./spec/controllers/clones_controller_spec.rb:7:in `block (3 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# ArgumentError:
# Nil location provided. Can't build URI.
# ./app/views/layouts/_navigation.html.haml:25:in `_app_views_layouts__navigation_html_haml__
Определение граватара в user.rb
:
def gravatar_url
md5 = Digest::MD5.hexdigest(email)
"https://www.gravatar.com/avatar/#{md5}"
end
_navigation.html.haml
файл:
%ul.nav.navbar-nav.pull-right{:style => 'font-size:12px'}
- if user_signed_in?
%li.dropdown.profile
%a.dropdown-toggle{:'data-toggle' => 'dropdown'}
= image_tag current_user.gravatar_url, class: 'gravatar'
= current_user.name
%b.caret
%ul.dropdown-menu
%li= link_to 'Permissions', command_permissions_path if can? :index, CommandPermission
%li= link_to 'Logout', logout_path, :method => :delete