ActiveAdmin无法在Heroku中完全运行,在本地运行完美。 Rails应用程序

时间:2016-03-22 18:13:06

标签: ruby-on-rails ruby heroku activeadmin

如果有人知道在哪里看,我一直在努力解决这个错误,我会非常感激。

问题:我在我的应用程序中运行ActiveAdmin,它在我本地运行时运行正常,但是当我在Heroku上运行时,我可以使用我的应用程序的所有功能,除了使用一个名为&#34的管理界面;任务&#34 ;.

当我打开"任务"我收到内部错误500。

我的ActiveAdmin的其他功能完美运行,我可以将数据保存到我的数据库。

这是我的宝石文件:

source 'https://rubygems.org'

gem 'rails', '4.2.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'formtastic'

gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc

gem 'materialize-sass'
gem 'devise', '~> 3.4.1'
gem 'toastr-rails'
gem 'mandrill-api', '1.0.52', require: 'mandrill'

gem 'omniauth'
gem 'omniauth-google-oauth2'
gem 'omniauth-facebook'
gem 'omniauth-github'
gem 'tzinfo-data'

gem 'activeadmin', github: 'activeadmin'
gem 'active_skin'

gem 'paperclip', '~> 4.2.1'

gem 'redcarpet', '~> 3.2.3'
gem 'coderay', '~> 1.1.0'

gem 'friendly_id', '~> 5.1.0'

gem 'active_admin-sortable_tree', '~> 0.2.1'

gem 'stripe', :git => 'https://github.com/stripe/stripe-ruby'

gem 'figaro', '~> 1.1.1'

gem 'aws-sdk'

group :development, :test do
  gem 'byebug'
  gem 'web-console', '~> 2.0'
  gem 'spring'
  gem 'sqlite3'
end

group :production do
  gem 'pg'
  gem 'rails_12factor'
end

这是我的日志:

-22T18:57:44.580763+00:00 app[web.1]: Processing by Admin::TasksController#index as HTML
-22T18:57:44.584610+00:00 app[web.1]:   AdminUser Load (1.8ms)  SELECT  "admin_users".* FROM "admin_users" WHERE "admin_users"."id" = $1  ORDER BY "admin_users"."id" ASC LIM
["id", 2]]
-22T18:57:44.617306+00:00 app[web.1]:    (1.2ms)  SELECT COUNT(count_column) FROM (SELECT  1 AS count_column FROM "tasks" LIMIT 10000 OFFSET 0) subquery_for_count
-22T18:57:44.618237+00:00 app[web.1]:   CACHE (0.0ms)  SELECT COUNT(count_column) FROM (SELECT  1 AS count_column FROM "tasks" LIMIT 10000 OFFSET 0) subquery_for_count
-22T18:57:44.620682+00:00 app[web.1]:    (1.1ms)  SELECT COUNT(*) FROM "tasks"
-22T18:57:44.621592+00:00 app[web.1]:   CACHE (0.0ms)  SELECT COUNT(count_column) FROM (SELECT  1 AS count_column FROM "tasks" LIMIT 10000 OFFSET 0) subquery_for_count
-22T18:57:44.624387+00:00 app[web.1]:   Task Load (1.4ms)  SELECT  "tasks".* FROM "tasks"  ORDER BY "tasks"."id" desc LIMIT 10000 OFFSET 0
-22T18:57:44.637054+00:00 app[web.1]:   Rendered vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/app/views/active_admin/resource/index.html.arb (49.8ms)
-22T18:57:44.637281+00:00 app[web.1]: Completed 500 Internal Server Error in 56ms
-22T18:57:44.658687+00:00 app[web.1]:
-22T18:57:44.658697+00:00 app[web.1]: ActionView::Template::Error (comparison of Fixnum with String failed):
-22T18:57:44.658699+00:00 app[web.1]:     1: insert_tag renderer_for(:index)
-22T18:57:44.658700+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/relation/delegation.rb:132:in `sort_by'
-22T18:57:44.658701+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/relation/delegation.rb:132:in `public_send'
-22T18:57:44.658701+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/relation/delegation.rb:132:in `method_missing'
-22T18:57:44.658702+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/relation/delegation.rb:99:in `method_missing'
-22T18:57:44.658703+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/active_admin-sortable_tree-0.2.1/lib/active_admin/views/index_as_sortable.rb:13:in `build'
-22T18:57:44.658703+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
-22T18:57:44.658704+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/context.rb:92:in `with_current_arbre_element'
-22T18:57:44.658705+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
-22T18:57:44.658705+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:26:in `build_tag'
-22T18:57:44.658706+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:39:in `insert_tag'
-22T18:57:44.658709+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/index.rb:139:in `block (2 levels) in rend
x'
-22T18:57:44.658709+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
-22T18:57:44.658710+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/context.rb:92:in `with_current_arbre_element'
-22T18:57:44.658711+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
-22T18:57:44.658712+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:26:in `build_tag'
-22T18:57:44.658712+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:39:in `insert_tag'
-22T18:57:44.658713+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:14:in `div'
-22T18:57:44.658715+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/index.rb:138:in `block in render_index'
-22T18:57:44.658716+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
-22T18:57:44.658716+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/context.rb:92:in `with_current_arbre_element'
-22T18:57:44.658717+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
-22T18:57:44.658718+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:26:in `build_tag'
-22T18:57:44.658718+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:39:in `insert_tag'
-22T18:57:44.658719+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:14:in `paginated_collection'
-22T18:57:44.658720+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/index.rb:132:in `render_index'
-22T18:57:44.658720+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/index.rb:50:in `build_collection'
-22T18:57:44.658721+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/index.rb:28:in `block in main_content'
-22T18:57:44.658722+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
-22T18:57:44.658723+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/context.rb:92:in `with_current_arbre_element'
-22T18:57:44.658723+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
-22T18:57:44.658724+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:26:in `build_tag'
-22T18:57:44.658725+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:39:in `insert_tag'
-22T18:57:44.658726+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:14:in `batch_action_form'
-22T18:57:44.658726+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/index.rb:36:in `wrap_with_batch_action_fo

-22T18:57:44.658727+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/index.rb:26:in `main_content'
-22T18:57:44.658732+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/base.rb:91:in `block (2 levels) in build_
ntent_wrapper'
-22T18:57:44.658733+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
-22T18:57:44.658734+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/context.rb:92:in `with_current_arbre_element'
-22T18:57:44.658735+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
-22T18:57:44.658735+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:26:in `build_tag'
-22T18:57:44.658736+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:39:in `insert_tag'
-22T18:57:44.658737+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:14:in `div'
-22T18:57:44.658737+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/base.rb:90:in `block in build_main_conten
er'
-22T18:57:44.658738+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
-22T18:57:44.658739+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/context.rb:92:in `with_current_arbre_element'
-22T18:57:44.658740+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
-22T18:57:44.658740+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:26:in `build_tag'
-22T18:57:44.658741+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:39:in `insert_tag'
-22T18:57:44.658742+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:14:in `div'
-22T18:57:44.658743+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/base.rb:89:in `build_main_content_wrapper

-22T18:57:44.658743+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/base.rb:75:in `block in build_page_conten

-22T18:57:44.658744+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
-22T18:57:44.658745+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/context.rb:92:in `with_current_arbre_element'
-22T18:57:44.658746+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
-22T18:57:44.658746+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:26:in `build_tag'
-22T18:57:44.658747+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:39:in `insert_tag'
-22T18:57:44.658748+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:14:in `div'
-22T18:57:44.658748+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/base.rb:74:in `build_page_content'
-22T18:57:44.658749+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/base.rb:52:in `block (2 levels) in build_

-22T18:57:44.658750+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
-22T18:57:44.658751+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/context.rb:92:in `with_current_arbre_element'
-22T18:57:44.658752+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
-22T18:57:44.658752+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:26:in `build_tag'
-22T18:57:44.658753+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:39:in `insert_tag'
-22T18:57:44.658754+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:14:in `div'
-22T18:57:44.658754+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/base.rb:48:in `block in build_page'
-22T18:57:44.658755+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/context.rb:92:in `with_current_arbre_element'
-22T18:57:44.658756+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
-22T18:57:44.658757+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/base.rb:47:in `build_page'
-22T18:57:44.658758+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/lib/active_admin/views/pages/base.rb:10:in `build'
-22T18:57:44.658758+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
-22T18:57:44.658762+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/context.rb:92:in `with_current_arbre_element'
-22T18:57:44.658763+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:26:in `build_tag'
-22T18:57:44.658764+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/element/builder_methods.rb:39:in `insert_tag'
-22T18:57:44.658765+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/app/views/active_admin/resource/index.html.arb:2:in `block in _vendor_
ruby_______bundler_gems_activeadmin___fd_c__fc___app_views_active_admin_resource_index_html_arb___3510243039498056837_70206307693640'
-22T18:57:44.658766+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/context.rb:45:in `instance_eval'
-22T18:57:44.658767+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/arbre-1.0.3/lib/arbre/context.rb:45:in `initialize'
-22T18:57:44.658767+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/app/views/active_admin/resource/index.html.arb:1:in `new'
-22T18:57:44.658768+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-18fd1c23fc60/app/views/active_admin/resource/index.html.arb:1:in `_vendor_bundle_ru
__bundler_gems_activeadmin___fd_c__fc___app_views_active_admin_resource_index_html_arb___3510243039498056837_70206307693640'
-22T18:57:44.658769+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/template.rb:145:in `block in render'
-22T18:57:44.658786+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:166:in `instrument'
-22T18:57:44.658787+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/template.rb:333:in `instrument'
-22T18:57:44.658788+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/template.rb:143:in `render'
-22T18:57:44.658788+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_templa

-22T18:57:44.658789+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
-22T18:57:44.658790+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `block in instrument'
-22T18:57:44.658790+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
-22T18:57:44.658791+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-
-22T18:57:44.658838+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `block in instrument'
-22T18:57:44.658839+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
-22T18:57:44.658840+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `instrument'
-22T18:57:44.658840+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
-22T18:57:44.658841+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
-22T18:57:44.658842+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
-22T18:57:44.658842+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:137:in `process'
-22T18:57:44.658843+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/rendering.rb:30:in `process'
-22T18:57:44.658844+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal.rb:195:in `dispatch'
-22T18:57:44.658845+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
-22T18:57:44.658845+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal.rb:236:in `block in action'
-22T18:57:44.658846+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:73:in `call'
-22T18:57:44.658846+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
-22T18:57:44.658847+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:42:in `serve'
-22T18:57:44.658847+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:43:in `block in serve'
-22T18:57:44.658848+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:30:in `each'
-22T18:57:44.658849+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:30:in `serve'
-22T18:57:44.658849+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:802:in `call'
-22T18:57:44.658854+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
-22T18:57:44.658855+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
-22T18:57:44.658856+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
-22T18:57:44.658856+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
-22T18:57:44.658857+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
-22T18:57:44.658857+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
-22T18:57:44.658858+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/warden-1.2.6/lib/warden/manager.rb:35:in `block in call'
-22T18:57:44.658859+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/warden-1.2.6/lib/warden/manager.rb:34:in `catch'
-22T18:57:44.658859+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/warden-1.2.6/lib/warden/manager.rb:34:in `call'
-22T18:57:44.658860+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/etag.rb:24:in `call'
-22T18:57:44.658861+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/conditionalget.rb:25:in `call'
-22T18:57:44.658861+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
-22T18:57:44.658862+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
-22T18:57:44.658863+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/flash.rb:260:in `call'
-22T18:57:44.658863+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:in `context'
-22T18:57:44.658864+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:220:in `call'
-22T18:57:44.658865+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/cookies.rb:560:in `call'
-22T18:57:44.658868+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/query_cache.rb:36:in `call'
-22T18:57:44.658869+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
-22T18:57:44.658870+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
-22T18:57:44.658870+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in `call'
-22T18:57:44.658871+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in `_run_callbacks'
-22T18:57:44.658872+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_call_callbacks'
-22T18:57:44.658873+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
-22T18:57:44.658873+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
-22T18:57:44.658874+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
-22T18:57:44.658874+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
-22T18:57:44.658875+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
-22T18:57:44.658876+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:38:in `call_app'
-22T18:57:44.658876+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `block in call'
-22T18:57:44.658877+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `block in tagged'
-22T18:57:44.658877+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:26:in `tagged'
-22T18:57:44.658878+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `tagged'
-22T18:57:44.658878+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `call'
-22T18:57:44.658879+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
-22T18:57:44.658880+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
-22T18:57:44.656956+00:00 heroku[router]: at=info method=GET path="/admin/tasks" host=www.mydomain.com request_id=c0a82d1f-490b-429f-9b09-48b6c75cd5d1 fwd="110.175.239.
no=web.1 connect=1ms service=88ms status=500 bytes=1754
-22T18:57:44.658880+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'
-22T18:57:44.658881+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
-22T18:57:44.658881+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/static.rb:113:in `call'
-22T18:57:44.658882+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
-22T18:57:44.658883+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/engine.rb:518:in `call'
-22T18:57:44.658884+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:164:in `call'
-22T18:57:44.658884+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/lock.rb:17:in `call'
-22T18:57:44.658885+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/content_length.rb:15:in `call'
-22T18:57:44.658886+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:88:in `service'
-22T18:57:44.658886+00:00 app[web.1]:   vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
-22T18:57:44.658887+00:00 app[web.1]:   vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
-22T18:57:44.658888+00:00 app[web.1]:   vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
-22T18:57:44.658888+00:00 app[web.1]:
-22T18:57:44.658889+00:00 app[web.1]:

应用程序/管理/ task.rb

ActiveAdmin.register Task do
    permit_params :title, :note, :video, :header, :tag, :project_id

    sortable tree: false,
                        sorting_attribute: :tag

    index :as => :sortable do
        label :title

        actions
    end

    index do 
        selectable_column
        column :header
        column :title
        column :tag
        column :project

        actions
    end

    form do |f|
        f.inputs do
            input :project, label: "Project"
            input :title, label: "Title"
            input :note, label: "Note"
            input :video, label: "video"
            input :header, label: "Header"
        end

        actions
    end

end

如果有人知道我该怎么做,我将永远感激不尽!如果我应该显示其他文件来解决这个问题,请告诉我,我会在这里添加它们。

1 个答案:

答案 0 :(得分:0)

我可以通过将sorting_attribute: :tag更改为sorting_attribute: :project_id

来排序此问题

我知道这可能不是最好的方法,但它解决了我的问题。非常感谢你评论并给了我明智的帮助,我欠你很大的时间!