Error shown while trying to set up shapado in laptop (Mac OS)

Asked By 30 points N/A Posted on -
qa-featured

Hello,

I am new in Shapado. I want to set up shapado in laptop (MAC OS), but when I want to access to http://localhost.lan:3000, the following error message occurs:

"NoMethodError in Questions#index

Showing /Users/sciruela/Documents/shapado/shapado/app/views/shared/_login_drop_down.html.haml where line #10 raised:

Undefined method `[]' for nil:NilClass
Extracted source (around line #10):

7:   = link_to provider.titleize, '/users/auth/facebook', :class => 'auth-provider Facebook', :id => 'facebook'
8:   – else
9:   %li
10:  = link_to provider.titleize, multiauth_url(provider), :class => "auth-provider #{provider}", :id => provider
11:
12:  -if current_group.allow_any_openid
13:  %li


Trace of template inclusion: app/views/shared/_login_menu.html.haml, app/views/shared/_topbar.html.haml, app/views/layouts/application.html.haml

Rails.root: /Users/sciruela/Documents/shapado/shapado

Application Trace | Framework Trace | Full Trace
app/views/shared/_login_drop_down.html.haml:10:in `block in

_app_views_shared__login_drop_down_html_haml__1123238317393261506_2159776840'
app/views/shared/_login_drop_down.html.haml:2:in `each'

app/views/shared/_login_drop_down.html.haml:2:in `_app_views_shared__login_drop_down_html_haml__1123238317393261506_2159776840'

app/views/shared/_login_menu.html.haml:6:in `_app_views_shared__login_menu_html_haml___434956048083202339_2193663100'

app/helpers/application_helper.rb:36:in `multiauth_dropdown'
app/views/shared/_topbar.html.haml:21:in `_app_views_shared__topbar_html_haml___2782218627514502243_2204427320'

app/views/layouts/application.html.haml:10:in `block in _app_views_layouts_application_html_haml___4514694021451724572_2205033860'

app/helpers/layout_helper.rb:74:in `call'
app/helpers/layout_helper.rb:74:in `block in ie_tag'

app/helpers/layout_helper.rb:72:in `ie_tag'
app/helpers/layout_helper.rb:79:in `ie_html'

app/views/layouts/application.html.haml:2:in `_app_views_layouts_application_html_haml___4514694021451724572_2205033860'

app/controllers/application_controller.rb:122:in `block (2 levels) in find_questions'
app/controllers/application_controller.rb:121:in `find_questions'

app/controllers/questions_controller.rb:67:in `index'
lib/sso_strategy.rb:18:in `call!'
app/middlewares/dynamic_domain.rb:17:in `call'


Request

I need to solve this error message. 

Please help me. 

Thanks a lot.

SHARE
Answered By 10 points N/A #149716

Error shown while trying to set up shapado in laptop (Mac OS)

qa-featured

Hello Louise,

The [] in Rails acts as a reader while the []= as a setter. It appears like the problem you are getting is occurring on line 10 that is at multiauth_url(provider). You will therefore need to check it or use a compiler to fix that error.

It also looks like that provider is nil in this case, and there what you will need to do is try using pry (a gem) and after that you will drop in binding.pry to debug the issue further. In the event that you are assuming that  a provider already exists, just check to make sure that the provider is not nil first.

Hope this helps.

Regards,

Carl

 

Related Questions