问题
I get an error in my heroku log because of kaminari . The pagnation does not either work on my local pc.
Here is my log:
I@PC /c/rails/myapp (master)
$ heroku logs
2011-05-04T12:24:15-07:00 heroku[web.1]: State changed from created to starting
2011-05-04T12:24:15-07:00 heroku[slugc]: Slug compilation finished
2011-05-04T19:24:16+00:00 app[web.1]: >> Stopping ...
2011-05-04T19:24:24+00:00 app[web.1]: >> Thin web server (v1.2.6 codename Crazy
Delicious)
2011-05-04T19:24:24+00:00 app[web.1]: >> Maximum connections set to 1024
2011-05-04T19:24:24+00:00 app[web.1]: >> Listening on 0.0.0.0:47387, CTRL+C to s
top
2011-05-04T12:24:25-07:00 heroku[web.1]: State changed from starting to up
2011-05-04T19:24:25+00:00 app[web.1]:
2011-05-04T19:24:25+00:00 app[web.1]:
2011-05-04T19:24:25+00:00 app[web.1]: Started GET "/konkurrencer" for MYIP
.103 at 2011-05-04 21:24:25 +0200
2011-05-04T19:24:32+00:00 app[web.1]:
2011-05-04T19:24:32+00:00 app[web.1]: ActionView::Template::Error (undefined loc
al variable or method `prev_span_tag' for #<Kaminari::Helpers::Paginator:0x00000
002ecfd68>):
2011-05-04T19:24:32+00:00 app[web.1]: 7: paginator: the paginator th
at renders the pagination tags inside
2011-05-04T19:24:32+00:00 app[web.1]: 8: -%>
2011-05-04T19:24:32+00:00 app[web.1]: 9: <%= paginator.render do -%>
2011-05-04T19:24:32+00:00 app[web.1]: 10: <nav class="pagination">
2011-05-04T19:24:32+00:00 app[web.1]: 11: <%= current_page > 1 ? prev_li
nk_tag : prev_span_tag %>
2011-05-04T19:24:32+00:00 app[web.1]: 12: <% each_page do |page| -%>
2011-05-04T19:24:32+00:00 heroku[router]: GET www.mydomain.com/konkurrencer d
yno=web.1 queue=0 wait=4886ms service=7712ms bytes=934
2011-05-04T19:24:32+00:00 app[web.1]: 13: <% if page.current? -%>
2011-05-04T19:24:32+00:00 app[web.1]: app/views/kaminari/_paginator.html.erb:1
0:in `block in _app_views_kaminari__paginator_html_erb__725244953667221486_24536
720_1356281899042952332'
2011-05-04T19:24:32+00:00 app[web.1]: app/views/kaminari/_paginator.html.erb:9
:in `_app_views_kaminari__paginator_html_erb__725244953667221486_24536720_135628
1899042952332'
2011-05-04T19:24:32+00:00 app[web.1]: app/views/public/_konkurrencerover.html.
erb:64:in `_app_views_public__konkurrencerover_html_erb__2362066465860094055_369
58600__2146794870136949115'
2011-05-04T19:24:32+00:00 app[web.1]: app/views/public/konkurrance_oversigt.ht
ml.erb:6:in `_app_views_public_konkurrance_oversigt_html_erb___11120586637878522
2_36976820_3788785275260735847'
2011-05-04T19:24:32+00:00 app[web.1]: app/controllers/public_controller.rb:50:
in `konkurrance_oversigt'
2011-05-04T19:24:32+00:00 app[web.1]:
2011-05-04T19:24:32+00:00 app[web.1]:
2011-05-04T12:28:14-07:00 heroku[slugc]: Slug compilation started
2011-05-04T12:29:24-07:00 heroku[api]: Deploy dd6947b by mail@mail.dk
2011-05-04T12:29:24-07:00 heroku[web.1]: State changed from up to bouncing
2011-05-04T12:29:24-07:00 heroku[web.1]: State changed from created to starting
2011-05-04T12:29:25-07:00 heroku[slugc]: Slug compilation finished
2011-05-04T19:29:27+00:00 app[web.1]: >> Stopping ...
2011-05-04T19:29:44+00:00 app[web.1]: >> Thin web server (v1.2.6 codename Crazy
Delicious)
2011-05-04T19:29:44+00:00 app[web.1]: >> Maximum connections set to 1024
2011-05-04T19:29:44+00:00 app[web.1]: >> Listening on 0.0.0.0:47011, CTRL+C to s
top
2011-05-04T12:29:45-07:00 heroku[web.1]: State changed from starting to up
2011-05-04T19:29:45+00:00 app[web.1]:
2011-05-04T19:29:45+00:00 app[web.1]:
2011-05-04T19:29:45+00:00 app[web.1]: Started GET "/konkurrencer" for MYIP
.103 at 2011-05-04 21:29:45 +0200
2011-05-04T19:29:55+00:00 app[web.1]:
2011-05-04T19:29:55+00:00 app[web.1]: ActionView::Template::Error (undefined loc
al variable or method `prev_span_tag' for #<Kaminari::Helpers::Paginator:0x00000
0031bf348>):
2011-05-04T19:29:55+00:00 app[web.1]: 7: paginator: the paginator th
at renders the pagination tags inside
2011-05-04T19:29:55+00:00 app[web.1]: 8: -%>
2011-05-04T19:29:55+00:00 app[web.1]: 9: <%= paginator.render do -%>
2011-05-04T19:29:55+00:00 app[web.1]: 10: <nav class="pagination">
2011-05-04T19:29:55+00:00 app[web.1]: 11: <%= current_page > 1 ? prev_li
nk_tag : prev_span_tag %>
2011-05-04T19:29:55+00:00 app[web.1]: 12: <% each_page do |page| -%>
2011-05-04T19:29:55+00:00 app[web.1]: 13: <% if page.current? -%>
2011-05-04T19:29:55+00:00 app[web.1]: app/views/kaminari/_paginator.html.erb:1
0:in `block in _app_views_kaminari__paginator_html_erb__2476358393629791780_2607
8020__2870189555522128661'
2011-05-04T19:29:55+00:00 app[web.1]: app/views/kaminari/_paginator.html.erb:9
:in `_app_views_kaminari__paginator_html_erb__2476358393629791780_26078020__2870
189555522128661'
2011-05-04T19:29:55+00:00 app[web.1]: app/views/public/_konkurrencerover.html.
erb:64:in `_app_views_public__konkurrencerover_html_erb__2012442462695600638_342
98200__2631176305645353613'
2011-05-04T19:29:55+00:00 app[web.1]: app/views/public/konkurrance_oversigt.ht
ml.erb:6:in `_app_views_public_konkurrance_oversigt_html_erb__328761828734281896
3_34321760__3231148984943757953'
2011-05-04T19:29:55+00:00 app[web.1]:
2011-05-04T19:29:55+00:00 heroku[router]: GET www.mydomain.com/konkurrencer d
yno=web.1 queue=0 wait=10897ms service=9692ms bytes=934
2011-05-04T19:29:55+00:00 app[web.1]:
2011-05-04T12:29:55-07:00 heroku[nginx]: GET /konkurrencer HTTP/1.1 | MYIP
.103 | 965 | http | 500
2011-05-04T12:31:08-07:00 heroku[cron.123]: State changed from created to starti
ng
2011-05-04T19:31:11+00:00 app[cron.123]: (in /app)
2011-05-04T12:31:13-07:00 heroku[cron.123]: State changed from starting to up
2011-05-04T19:31:14+00:00 app[cron.123]: rake aborted!
2011-05-04T19:31:14+00:00 app[cron.123]: Don't know how to build task 'cron'
2011-05-04T19:31:14+00:00 app[cron.123]: /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1
720:in `[]'
2011-05-04T19:31:14+00:00 app[cron.123]: /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2
040:in `invoke_task'
2011-05-04T19:31:14+00:00 app[cron.123]: /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2
019:in `block (2 levels) in top_level'
2011-05-04T19:31:14+00:00 app[cron.123]: /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2
019:in `each'
2011-05-04T19:31:14+00:00 app[cron.123]: /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2
019:in `block in top_level'
2011-05-04T19:31:14+00:00 app[cron.123]: /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2
058:in `standard_exception_handling'
2011-05-04T19:31:14+00:00 app[cron.123]: /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2
013:in `top_level'
2011-05-04T19:31:14+00:00 app[cron.123]: /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1
992:in `run'
2011-05-04T19:31:14+00:00 app[cron.123]: /usr/ruby1.9.2/bin/rake:31:in `<main>'
2011-05-04T12:31:15-07:00 heroku[cron.123]: State changed from up to complete
2011-05-04T12:32:59-07:00 heroku[slugc]: Slug compilation started
2011-05-04T12:34:09-07:00 heroku[api]: Deploy 61da0e6 by mail@mail.dk
2011-05-04T12:34:10-07:00 heroku[web.1]: State changed from up to bouncing
2011-05-04T12:34:10-07:00 heroku[web.1]: State changed from created to starting
2011-05-04T19:34:12+00:00 app[web.1]: >> Stopping ...
2011-05-04T19:34:21+00:00 app[web.1]: >> Thin web server (v1.2.6 codename Crazy
Delicious)
2011-05-04T19:34:21+00:00 app[web.1]: >> Maximum connections set to 1024
2011-05-04T19:34:21+00:00 app[web.1]: >> Listening on 0.0.0.0:27960, CTRL+C to s
top
2011-05-04T12:34:23-07:00 heroku[web.1]: State changed from starting to up
2011-05-04T19:34:37+00:00 app[web.1]:
2011-05-04T19:34:37+00:00 app[web.1]:
2011-05-04T19:34:37+00:00 app[web.1]: Started GET "/konkurrencer" for MYIP
.103 at 2011-05-04 21:34:37 +0200
2011-05-04T19:34:45+00:00 app[web.1]:
2011-05-04T19:34:45+00:00 app[web.1]: ActionView::Template::Error (undefined loc
al variable or method `prev_span_tag' for #<Kaminari::Helpers::Paginator:0x00000
0034fd230>):
2011-05-04T19:34:45+00:00 app[web.1]: 7: paginator: the paginator th
at renders the pagination tags inside
2011-05-04T19:34:45+00:00 app[web.1]: 8: -%>
2011-05-04T19:34:45+00:00 app[web.1]: 9: <%= paginator.render do -%>
2011-05-04T19:34:45+00:00 app[web.1]: 10: <nav class="pagination">
2011-05-04T19:34:45+00:00 app[web.1]: 11: <%= current_page > 1 ? prev_li
nk_tag : prev_span_tag %>
2011-05-04T19:34:45+00:00 app[web.1]: 12: <% each_page do |page| -%>
2011-05-04T19:34:45+00:00 app[web.1]: 13: <% if page.current? -%>
2011-05-04T19:34:45+00:00 app[web.1]: app/views/kaminari/_paginator.html.erb:1
0:in `block in _app_views_kaminari__paginator_html_erb___3606315283206445500_277
77580_2894340309128370593'
2011-05-04T19:34:45+00:00 app[web.1]: app/views/kaminari/_paginator.html.erb:9
:in `_app_views_kaminari__paginator_html_erb___3606315283206445500_27777580_2894
340309128370593'
2011-05-04T19:34:45+00:00 app[web.1]: app/views/public/_konkurrencerover.html.
erb:64:in `_app_views_public__konkurrencerover_html_erb___3512818278792024874_36
003660__1579052516165392433'
2011-05-04T19:34:45+00:00 app[web.1]: app/views/public/konkurrance_oversigt.ht
ml.erb:6:in `_app_views_public_konkurrance_oversigt_html_erb__232109981411746762
7_36020400_4338420183149633978'
2011-05-04T19:34:45+00:00 app[web.1]:
2011-05-04T19:34:45+00:00 app[web.1]:
2011-05-04T19:34:45+00:00 heroku[router]: GET www.mydomain.com/konkurrencer d
yno=web.1 queue=0 wait=0ms service=8062ms bytes=934
I@PC /c/rails/myapp (master)
$
My view file:
<% @konkurrencerb.each do |vind| %>
SOME CODE
<% end %>
</table>
<div id="pagenavi">
<%= hidden_field_tag :direction, params[:direction] %>
<%= hidden_field_tag :sort, params[:sort] %>
<%= paginate @konkurrencerb %>
My controller:
def konkurrance_oversigt
@konkurrencerb = Konkurrancer.page(params[:page]).per(15)
@titel = 'konkurranceoversigt'
end
回答1:
It seems you're using an old custom theme for Kaminari '< 0.11' with newer Kaminari gem.
Can you please delete the whole
app/views/kaminari
directory and recreate your pagination template again? Thanks!
来源:https://stackoverflow.com/questions/5888995/rails-heroku-help-kaminari-view-error