1

我是Shapado的新手。我正在尝试在我的笔记本电脑(MAC OS)中安装 shapado,当我尝试访问http://localhost.lan:3000时出现以下错误:

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 => dprovider
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

我怎么能解决它?

谢谢

4

2 回答 2

2

在 Rails 中,[]充当读取器和[]=设置器。看起来问题发生在第 10 行的multiauth_url(provider).

在这种情况下,提供者似乎也是nil如此。我建议使用pry(a gem) 并binding.pry进一步调试。您可能会假设提供者始终存在,因此请验证该提供者不是nil第一个。

于 2012-04-26T12:09:46.527 回答
1

did you follow shapado's Readme? seems like you did not this step https://github.com/ricodigo/shapado/blob/master/README#L25

于 2012-04-27T04:32:32.173 回答