I am new to Rails so pardon if this question is relatively simple - I went through all the other similar errors on SO and no solutions were of use.
I am trying to print a list of ingredients from this api call and getting the error Rails: undefined method 'ingredients' for nil:NilClass. Any help is appreciated!
My code snippets are:
about page:
<% content_for :title do %>About<% end %>
<h3>About the Website</h3>
<p>
This web application was created with
<%= link_to('Rails Composer', 'http://railsapps.github.io/rails-composer/') %>
from the <%= link_to('RailsApps project', 'http://railsapps.github.io/') %>.
Ingredients are <%= #recommendations.ingredients %>
</p>
model:
class Recommendations
require 'httparty'
attr_accessor :matches, :ingredients
def fetch_recipe
encoded_url = URI.encode("http://api.yummly.com/v1/api/recipes?_app_id=ca19779e&_app_key=125204344682094834d68637a8222adf&q=chicken&allowedCourse[]=course^course-Lunch&maxResult=100&start=1")
parsed_url = URI.parse(encoded_url)
HTTParty.get(parsed_url)
end
def initialize
recipe_hash = fetch_recipe
assign_values(recipe_hash)
end
def assign_values(recipe_hash)
recipe_response = recipe_hash.parsed_response['matches'][0]
self.ingredients = recipe_response['ingredients']
end
end
controller:
class RecommendationsController < ApplicationController
def home
#recommendations = Recommendations.new
end
end
logs:
Started GET "/pages/about" for 127.0.0.1 at 2014-07-28 17:43:40 -0700
Processing by HighVoltage::PagesController#show as HTML
Parameters: {"id"=>"about"}
Rendered pages/about.html.erb within layouts/application (1.0ms)
Completed 500 Internal Server Error in 4ms
NoMethodError - undefined method `ingredients' for nil:NilClass:
app/views/pages/about.html.erb:7:in `_app_views_pages_about_html_erb___310183375408592724_70240131703120'
actionview (4.1.2) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.2) lib/active_support/notifications.rb:161:in `instrument'
actionview (4.1.2) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.2) lib/action_view/template.rb:143:in `render'
actionview (4.1.2) lib/action_view/renderer/template_renderer.rb:55:in `block (2 levels) in render_template'
actionview (4.1.2) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.1.2) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.2) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.2) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionview (4.1.2) lib/action_view/renderer/template_renderer.rb:54:in `block in render_template'
actionview (4.1.2) lib/action_view/renderer/template_renderer.rb:62:in `render_with_layout'
actionview (4.1.2) lib/action_view/renderer/template_renderer.rb:53:in `render_template'
actionview (4.1.2) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionview (4.1.2) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (4.1.2) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (4.1.2) lib/action_view/rendering.rb:99:in `_render_template'
actionpack (4.1.2) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (4.1.2) lib/action_view/rendering.rb:82:in `render_to_body'
actionpack (4.1.2) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
actionpack (4.1.2) lib/action_controller/metal/renderers.rb:32:in `render_to_body'
actionpack (4.1.2) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (4.1.2) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.1.2) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.1.2) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
activesupport (4.1.2) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.1.2) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.1.2) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.1.2) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.1.2) lib/action_controller/metal/instrumentation.rb:40:in `render'
high_voltage (2.2.0) app/controllers/concerns/high_voltage/static_page.rb:28:in `show'
actionpack (4.1.2) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.1.2) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.1.2) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.1.2) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.1.2) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.2) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.2) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.2) lib/active_support/callbacks.rb:149:in `call'
activesupport (4.1.2) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.2) lib/active_support/callbacks.rb:229:in `call'
activesupport (4.1.2) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.2) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.2) lib/active_support/callbacks.rb:86:in `call'
activesupport (4.1.2) lib/active_support/callbacks.rb:86:in `run_callbacks'
actionpack (4.1.2) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.1.2) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.1.2) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.1.2) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.2) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.1.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.1.2) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.1.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.1.2) lib/abstract_controller/base.rb:136:in `process'
actionview (4.1.2) lib/action_view/rendering.rb:30:in `process'
actionpack (4.1.2) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.1.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.1.2) lib/action_controller/metal.rb:232:in `block in action'
actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:82:in `call'
actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:50:in `call'
actionpack (4.1.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.1.2) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.2) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.2) lib/action_dispatch/routing/route_set.rb:678:in `call'
bullet (4.12.0) lib/bullet/rack.rb:10:in `call'
meta_request (0.3.3) lib/meta_request/middlewares/app_request_handler.rb:13:in `call'
rack-contrib (1.1.0) lib/rack/contrib/response_headers.rb:17:in `call'
meta_request (0.3.3) lib/meta_request/middlewares/headers.rb:16:in `call'
meta_request (0.3.3) lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.1.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.1.2) lib/action_dispatch/middleware/flash.rb:254:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.1.2) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.1.2) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.1.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
activerecord (4.1.2) lib/active_record/migration.rb:380:in `call'
actionpack (4.1.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.2) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.1.2) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.1.2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
better_errors (1.1.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (1.1.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (1.1.0) lib/better_errors/middleware.rb:56:in `call'
actionpack (4.1.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.1.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.2) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.2) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.2) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.2) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.0.3) lib/quiet_assets.rb:23:in `call_with_quiet_assets'
actionpack (4.1.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.2) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.1.2) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.1.2) lib/rails/engine.rb:514:in `call'
railties (4.1.2) lib/rails/application.rb:144:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
thin (1.6.2) lib/thin/connection.rb:86:in `block in pre_process'
thin (1.6.2) lib/thin/connection.rb:84:in `catch'
thin (1.6.2) lib/thin/connection.rb:84:in `pre_process'
thin (1.6.2) lib/thin/connection.rb:53:in `process'
thin (1.6.2) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run_machine'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
thin (1.6.2) lib/thin/backends/base.rb:73:in `start'
thin (1.6.2) lib/thin/server.rb:162:in `start'
rack (1.5.2) lib/rack/handler/thin.rb:16:in `run'
rack (1.5.2) lib/rack/server.rb:264:in `start'
railties (4.1.2) lib/rails/commands/server.rb:69:in `start'
railties (4.1.2) lib/rails/commands/commands_tasks.rb:81:in `block in server'
railties (4.1.2) lib/rails/commands/commands_tasks.rb:76:in `tap'
railties (4.1.2) lib/rails/commands/commands_tasks.rb:76:in `server'
railties (4.1.2) lib/rails/commands/commands_tasks.rb:40:in `run_command!'
railties (4.1.2) lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:8:in `require'
bin/rails:8:in `<top (required)>'
spring (1.1.3) lib/spring/client/rails.rb:27:in `load'
spring (1.1.3) lib/spring/client/rails.rb:27:in `call'
spring (1.1.3) lib/spring/client/command.rb:7:in `call'
spring (1.1.3) lib/spring/client.rb:26:in `run'
spring (1.1.3) bin/spring:48:in `<top (required)>'
spring (1.1.3) lib/spring/binstub.rb:11:in `load'
spring (1.1.3) lib/spring/binstub.rb:11:in `<top (required)>'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
bin/spring:16:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
class RecommendationsController < ApplicationController
def home
#recommendations = Recommendations.new
end
def about
#recommendations = Recommendations.new
end
end
add the recommendations instantiation to your about action too.
Better yet, refactor it into a method:
class RecommendationsController < ApplicationController
before_filter :new_recommendation, :only =>[:home, :about]
private
def new_recommentation
#recommendations = Recommendations.new
end
end
Ingredients of nil can, most logically, be also nil. Solve your problem by defining
def nil.ingredients
nil
end
Related
I try to add a "show" Interface for payments on Active Admin, so I added this code to my file "app/admin/payments.rb" :
ActiveAdmin.register Payment do
actions :index, :show
index do
column "Actions" do |payment|
links = []
links << link_to("View", admin_payment_path(payment))
links.join(" <br><br> ").html_safe
end
end
show do
attributes_table do
row :id
row :remote_id
row :credit_card_id
row :State
row :Refund_id
row :Created_at
row :updated_at
row :amount
row :currency
row :subscription_id
end
active_admin_comments
end
end
And I call this show action like that :
link_to("View", admin_payment_path(payment))
I have the following error thaht I can not understand :
ActionView::Template::Error (wrong number of arguments (1 for 0)):
1: insert_tag renderer_for(:show)
activerecord (4.0.3) lib/active_record/attribute_methods/read.rb:58:in `__temp__d6564786f646'
/ruby/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/view_helpers/display_helper.rb:30:in `display_name_method_for'
/ruby/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/view_helpers/display_helper.rb:18:in `display_name'
arbre (1.0.1) lib/arbre/element.rb:175:in `method_missing'
/ruby/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/show.rb:36:in `default_title'
/ruby/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/show.rb:14:in `title'
/ruby/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:25:in `block in build_active_admin_head'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
/ruby/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:24:in `build_active_admin_head'
/ruby/bundler/gems/active_admin-9ca081f47ab4/lib/active_admin/views/pages/base.rb:9:in `build'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
/ruby/bundler/gems/active_admin-9ca081f47ab4/app/views/active_admin/resource/show.html.arb:1:in `block in __ruby_bundler_gems_active_admin__ca___f__ab__app_views_active_admin_resource_show_html_arb__2881818806947822812_77228080'
arbre (1.0.1) lib/arbre/context.rb:45:in `instance_eval'
arbre (1.0.1) lib/arbre/context.rb:45:in `initialize'
/ruby/bundler/gems/active_admin-9ca081f47ab4/app/views/active_admin/resource/show.html.arb:1:in `new'
/ruby/bundler/gems/active_admin-9ca081f47ab4/app/views/active_admin/resource/show.html.arb:1:in `__ruby_bundler_gems_active_admin__ca___f__ab__app_views_active_admin_resource_show_html_arb__2881818806947822812_77228080'
actionpack (4.0.3) lib/action_view/template.rb:143:in `block in render'
activesupport (4.0.3) lib/active_support/notifications.rb:161:in `instrument'
actionpack (4.0.3) lib/action_view/template.rb:141:in `render'
actionpack (4.0.3) lib/action_view/renderer/template_renderer.rb:49:in `block (2 levels) in render_template'
actionpack (4.0.3) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.0.3) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.3) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.3) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionpack (4.0.3) lib/action_view/renderer/template_renderer.rb:48:in `block in render_template'
actionpack (4.0.3) lib/action_view/renderer/template_renderer.rb:56:in `render_with_layout'
actionpack (4.0.3) lib/action_view/renderer/template_renderer.rb:47:in `render_template'
actionpack (4.0.3) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionpack (4.0.3) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionpack (4.0.3) lib/action_view/renderer/renderer.rb:23:in `render'
actionpack (4.0.3) lib/abstract_controller/rendering.rb:127:in `_render_template'
actionpack (4.0.3) lib/action_controller/metal/streaming.rb:219:in `_render_template'
actionpack (4.0.3) lib/abstract_controller/rendering.rb:120:in `render_to_body'
actionpack (4.0.3) lib/action_controller/metal/rendering.rb:33:in `render_to_body'
actionpack (4.0.3) lib/action_controller/metal/renderers.rb:26:in `render_to_body'
actionpack (4.0.3) lib/abstract_controller/rendering.rb:97:in `render'
actionpack (4.0.3) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.0.3) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.0.3) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/usr/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
activesupport (4.0.3) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.0.3) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.0.3) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.0.3) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.0.3) lib/action_controller/metal/instrumentation.rb:40:in `render'
actionpack (4.0.3) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (4.0.3) lib/action_controller/metal/responder.rb:233:in `default_render'
actionpack (4.0.3) lib/action_controller/metal/responder.rb:161:in `to_html'
responders (1.0.0) lib/responders/flash_responder.rb:104:in `to_html'
actionpack (4.0.3) lib/action_controller/metal/responder.rb:154:in `respond'
actionpack (4.0.3) lib/action_controller/metal/responder.rb:147:in `call'
actionpack (4.0.3) lib/action_controller/metal/mime_responds.rb:330:in `respond_with'
inherited_resources (1.4.1) lib/inherited_resources/actions.rb:13:in `show'
actionpack (4.0.3) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.0.3) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.0.3) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.0.3) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (4.0.3) lib/active_support/callbacks.rb:463:in `_run__1186283259363649751__process_action__callbacks'
activesupport (4.0.3) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.3) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (4.0.3) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.0.3) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.0.3) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.3) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.3) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.0.3) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (4.0.3) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.0.3) lib/abstract_controller/base.rb:136:in `process'
actionpack (4.0.3) lib/abstract_controller/rendering.rb:44:in `process'
actionpack (4.0.3) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.0.3) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.0.3) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.0.3) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.3) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.3) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:680:in `call'
omniauth (1.4.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.4.2) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.4.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.4.2) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.4.2) lib/omniauth/builder.rb:63:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.5) lib/rack/etag.rb:23:in `call'
rack (1.5.5) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.5) lib/rack/head.rb:11:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.5) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.5) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.3) lib/active_record/query_cache.rb:36:in `call'
airbrake (9.0.2) lib/airbrake/rack/middleware.rb:33:in `call!'
airbrake (9.0.2) lib/airbrake/rack/middleware.rb:21:in `call'
activerecord (4.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.3) lib/active_support/callbacks.rb:373:in `_run__4337536015866295967__call__callbacks'
activesupport (4.0.3) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.3) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.3) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.3) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.5) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.3) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.5) lib/rack/lock.rb:17:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.5) lib/rack/sendfile.rb:112:in `call'
rack-cors (0.4.1) lib/rack/cors.rb:81:in `call'
railties (4.0.3) lib/rails/engine.rb:511:in `call'
railties (4.0.3) lib/rails/application.rb:97:in `call'
rack (1.5.5) lib/rack/content_length.rb:14:in `call'
thin (1.5.1) lib/thin/connection.rb:81:in `block in pre_process'
thin (1.5.1) lib/thin/connection.rb:79:in `catch'
thin (1.5.1) lib/thin/connection.rb:79:in `pre_process'
thin (1.5.1) lib/thin/connection.rb:54:in `process'
thin (1.5.1) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run_machine'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
thin (1.5.1) lib/thin/backends/base.rb:63:in `start'
thin (1.5.1) lib/thin/server.rb:159:in `start'
rack (1.5.5) lib/rack/handler/thin.rb:16:in `run'
rack (1.5.5) lib/rack/server.rb:264:in `start'
railties (4.0.3) lib/rails/commands/server.rb:84:in `start'
railties (4.0.3) lib/rails/commands.rb:76:in `block in <top (required)>'
railties (4.0.3) lib/rails/commands.rb:71:in `tap'
railties (4.0.3) lib/rails/commands.rb:71:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
Rendered /ruby/gems/actionpack-4.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms)
Rendered /ruby/gems/actionpack-4.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.4ms)
Rendered /ruby/gems/actionpack-4.0.3/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (10.3ms)
Thank you for your help, I am a beginner in Ruby On Rails and ActiveAdmin
It looks like the block opened by attributes_table do isn't closed, so I'd start by adding an end after the last row line and seeing if the error changes or disappears.
Also, for what it's worth, based on ActiveAdmin's API documentation, I don't think the line actions :index, :show is necessary -- it specifically says that "all CRUD actions are enabled by default", so there shouldn't be a need to explicitly define those actions. I might try taking it out and seeing what happens.
The exception indicates ActiveAdmin is not finding a default title for the page, so try:
show title: 'Payment' do
...
end
or define a display_name() method on the Payment model.
I am trying to setup devise confirmable and testing with mailcatcher. When I try to signup I get end of file reached error with and it points to the create action of the registrations controller. I am using cloud9. I start mailcatcher with mailcatcher --http-port 8081 --ip $IP -f. I start my server with rails server -b $IP -p $PORT. My development.rb file:
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
host = "cloud9-url"
config.action_mailer.default_url_options = { host: host }
config.action_mailer.smtp_settings = { :address => host, :port => 8081 }
I also have the line config.mailer_sender = 'noreply#example.com' in my devise.rb file.
Here's the server log:
Completed 500 Internal Server Error in 30854ms
EOFError (end of file reached):
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/openssl/buffering.rb:182:in `sysread_nonblock'
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/openssl/buffering.rb:182:in `read_nonblock'
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/protocol.rb:153:in `rbuf_fill'
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/protocol.rb:134:in `readuntil'
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/protocol.rb:144:in `readline'
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/smtp.rb:945:in `recv_response'
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/smtp.rb:555:in `block in do_start'
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/smtp.rb:955:in `critical'
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/smtp.rb:555:in `do_start'
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/smtp.rb:520:in `start'
mail (2.6.3) lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'
mail (2.6.3) lib/mail/message.rb:2141:in `do_delivery'
mail (2.6.3) lib/mail/message.rb:236:in `block in deliver'
actionmailer (4.1.7) lib/action_mailer/base.rb:527:in `block in deliver_mail'
activesupport (4.1.7) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.7) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.7) lib/active_support/notifications.rb:159:in `instrument'
actionmailer (4.1.7) lib/action_mailer/base.rb:525:in `deliver_mail'
mail (2.6.3) lib/mail/message.rb:236:in `deliver'
devise (3.5.2) lib/devise/models/authenticatable.rb:172:in `send_devise_notification'
devise (3.5.2) lib/devise/models/confirmable.rb:116:in `send_confirmation_instructions'
devise (3.5.2) lib/devise/models/confirmable.rb:172:in `send_on_create_confirmation_instructions'
activesupport (4.1.7) lib/active_support/callbacks.rb:424:in `block in make_lambda'
activesupport (4.1.7) lib/active_support/callbacks.rb:221:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:221:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:86:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:86:in `run_callbacks'
activerecord (4.1.7) lib/active_record/callbacks.rb:306:in `_create_record'
activerecord (4.1.7) lib/active_record/timestamp.rb:57:in `_create_record'
activerecord (4.1.7) lib/active_record/persistence.rb:483:in `create_or_update'
activerecord (4.1.7) lib/active_record/callbacks.rb:302:in `block in create_or_update'
activesupport (4.1.7) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:86:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:86:in `run_callbacks'
activerecord (4.1.7) lib/active_record/callbacks.rb:302:in `create_or_update'
activerecord (4.1.7) lib/active_record/persistence.rb:103:in `save'
activerecord (4.1.7) lib/active_record/validations.rb:51:in `save'
activerecord (4.1.7) lib/active_record/attribute_methods/dirty.rb:21:in `save'
activerecord (4.1.7) lib/active_record/transactions.rb:268:in `block (2 levels) in save'
activerecord (4.1.7) lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
activerecord (4.1.7) lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
activerecord (4.1.7) lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
activerecord (4.1.7) lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
activerecord (4.1.7) lib/active_record/transactions.rb:208:in `transaction'
activerecord (4.1.7) lib/active_record/transactions.rb:326:in `with_transaction_returning_status'
activerecord (4.1.7) lib/active_record/transactions.rb:268:in `block in save'
activerecord (4.1.7) lib/active_record/transactions.rb:283:in `rollback_active_record_state!'
activerecord (4.1.7) lib/active_record/transactions.rb:267:in `save'
devise (3.5.2) app/controllers/devise/registrations_controller.rb:17:in `create'
actionpack (4.1.7) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.1.7) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.1.7) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.1.7) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.1.7) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:229:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:229:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.7) lib/active_support/callbacks.rb:149:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:149:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.7) lib/active_support/callbacks.rb:86:in `call'
activesupport (4.1.7) lib/active_support/callbacks.rb:86:in `run_callbacks'
actionpack (4.1.7) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.1.7) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.1.7) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.1.7) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.7) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.7) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.1.7) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.1.7) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.1.7) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.1.7) lib/abstract_controller/base.rb:136:in `process'
actionview (4.1.7) lib/action_view/rendering.rb:30:in `process'
actionpack (4.1.7) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.1.7) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.1.7) lib/action_controller/metal.rb:232:in `block in action'
actionpack (4.1.7) lib/action_dispatch/routing/route_set.rb:82:in `call'
actionpack (4.1.7) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
actionpack (4.1.7) lib/action_dispatch/routing/route_set.rb:50:in `call'
actionpack (4.1.7) lib/action_dispatch/routing/mapper.rb:45:in `call'
actionpack (4.1.7) lib/action_dispatch/journey/router.rb:73:in `block in call'
actionpack (4.1.7) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.7) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.7) lib/action_dispatch/routing/route_set.rb:678:in `call'
omniauth (1.1.4) lib/omniauth/strategy.rb:184:in `call!'
omniauth (1.1.4) lib/omniauth/strategy.rb:164:in `call'
newrelic_rpm (3.6.7.152) lib/new_relic/rack/error_collector.rb:43:in `call'
newrelic_rpm (3.6.7.152) lib/new_relic/rack/agent_hooks.rb:22:in `call'
newrelic_rpm (3.6.7.152) lib/new_relic/rack/browser_monitoring.rb:16:in `call'
newrelic_rpm (3.6.7.152) lib/new_relic/rack/developer_mode.rb:28:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.5) lib/rack/etag.rb:23:in `call'
rack (1.5.5) lib/rack/conditionalget.rb:35:in `call'
rack (1.5.5) lib/rack/head.rb:11:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/flash.rb:254:in `call'
rack (1.5.5) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.5) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.1.7) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.1.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.7) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.7) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.7) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.7) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.7) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.7) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.7) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.7) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.5) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.7) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
rack (1.5.5) lib/rack/lock.rb:17:in `call'
actionpack (4.1.7) lib/action_dispatch/middleware/static.rb:84:in `call'
rack (1.5.5) lib/rack/sendfile.rb:112:in `call'
railties (4.1.7) lib/rails/engine.rb:514:in `call'
railties (4.1.7) lib/rails/application.rb:144:in `call'
rack (1.5.5) lib/rack/lock.rb:17:in `call'
rack (1.5.5) lib/rack/content_length.rb:14:in `call'
rack (1.5.5) lib/rack/handler/webrick.rb:60:in `service'
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
Rendered /usr/local/rvm/gems/ruby-2.2.2/gems/actionpack-4.1.7/lib/action_dispatch/middleware/templates/rescues/_source.erb (0.8ms)
Rendered /usr/local/rvm/gems/ruby-2.2.2/gems/actionpack-4.1.7/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.7ms)
Rendered /usr/local/rvm/gems/ruby-2.2.2/gems/actionpack-4.1.7/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.3ms)
Rendered /usr/local/rvm/gems/ruby-2.2.2/gems/actionpack-4.1.7/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (29.7ms)
Things seem to work ok when I don't use mailcatcher, meaning after I make these changes to the development.rb file:
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :test
host = 'cloud9-url'
config.action_mailer.default_url_options = { host: host }
I then run the server and signup and I no longer get any errors.
Edit: If cloud9 is https would this mean I need to change anything in my development.rb file?
Having trouble getting the filterrific gem to work. I am getting the error "ERROR: undefined method `empty?' for nil:NilClass", it seems like the problem comes from the f.select in my form.
I have attached the relevant code in this link: https://github.com/jhund/filterrific/issues/26
I have been trying to get this gem to work all day with no luck. Great documentation, but just can't get it to work. Would appreciate any pointers.
[STACK TRACE]
NoMethodError - undefined method `empty?' for nil:NilClass:
actionview (4.1.4) lib/action_view/helpers/tags/select.rb:36:in `grouped_choices?'
actionview (4.1.4) lib/action_view/helpers/tags/select.rb:20:in `render'
actionview (4.1.4) lib/action_view/helpers/form_options_helper.rb:165:in `select'
actionview (4.1.4) lib/action_view/helpers/form_options_helper.rb:779:in `select'
() Users/erikchan/Workspace/productchamp/app/views/projects/_admin_angels.html.erb:9:in `block in _app_views_projects__admin_angels_html_erb___4541097495823350739_70281797177960'
actionview (4.1.4) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionview (4.1.4) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionview (4.1.4) lib/action_view/helpers/capture_helper.rb:38:in `capture'
actionview (4.1.4) lib/action_view/helpers/form_helper.rb:434:in `form_for'
filterrific (1.4.2) lib/filterrific/action_view_extension.rb:18:in `form_for'
() Users/erikchan/Workspace/productchamp/app/views/projects/_admin_angels.html.erb:6:in `_app_views_projects__admin_angels_html_erb___4541097495823350739_70281797177960'
actionview (4.1.4) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.4) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.4) lib/action_view/template.rb:143:in `render'
actionview (4.1.4) lib/action_view/renderer/partial_renderer.rb:306:in `render_partial'
actionview (4.1.4) lib/action_view/renderer/partial_renderer.rb:279:in `block in render'
actionview (4.1.4) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.4) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionview (4.1.4) lib/action_view/renderer/partial_renderer.rb:278:in `render'
actionview (4.1.4) lib/action_view/renderer/renderer.rb:47:in `render_partial'
actionview (4.1.4) lib/action_view/helpers/rendering_helper.rb:35:in `render'
() Users/erikchan/Workspace/productchamp/app/views/projects/show_dashboard.html.erb:34:in `_app_views_projects_show_dashboard_html_erb___2410799250841293991_70281799504140'
actionview (4.1.4) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.4) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.4) lib/action_view/template.rb:143:in `render'
actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:55:in `block (2 levels) in render_template'
actionview (4.1.4) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.4) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:54:in `block in render_template'
actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:62:in `render_with_layout'
actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:53:in `render_template'
actionview (4.1.4) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionview (4.1.4) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (4.1.4) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (4.1.4) lib/action_view/rendering.rb:99:in `_render_template'
actionpack (4.1.4) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (4.1.4) lib/action_view/rendering.rb:82:in `render_to_body'
actionpack (4.1.4) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
actionpack (4.1.4) lib/action_controller/metal/renderers.rb:32:in `render_to_body'
actionpack (4.1.4) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (4.1.4) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.1.4) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
() Users/erikchan/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
activesupport (4.1.4) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.1.4) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:40:in `render'
remotipart (1.2.1) lib/remotipart/render_overrides.rb:14:in `render_with_remotipart'
actionpack (4.1.4) lib/action_controller/metal/mime_responds.rb:258:in `respond_to'
() Users/erikchan/Workspace/productchamp/app/controllers/projects_controller.rb:118:in `show_dashboard'
actionpack (4.1.4) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.1.4) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.1.4) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.1.4) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.1.4) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.4) lib/active_support/callbacks.rb:86:in `run_callbacks'
actionpack (4.1.4) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.1.4) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.4) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.1.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.1.4) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.1.4) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.1.4) lib/abstract_controller/base.rb:136:in `process'
actionview (4.1.4) lib/action_view/rendering.rb:30:in `process'
actionpack (4.1.4) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.1.4) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.1.4) lib/action_controller/metal.rb:232:in `block in action'
actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:50:in `call'
actionpack (4.1.4) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.1.4) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:678:in `call'
omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.2.2) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.2) lib/omniauth/strategy.rb:164:in `call'
newrelic_rpm (3.7.3.204) lib/new_relic/rack/error_collector.rb:55:in `call'
newrelic_rpm (3.7.3.204) lib/new_relic/rack/agent_hooks.rb:32:in `call'
newrelic_rpm (3.7.3.204) lib/new_relic/rack/browser_monitoring.rb:27:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
remotipart (1.2.1) lib/remotipart/middleware.rb:27:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/flash.rb:254:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.1.4) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.1.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
activerecord (4.1.4) lib/active_record/migration.rb:380:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.4) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
better_errors (2.0.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (2.0.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (2.0.0) lib/better_errors/middleware.rb:57:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.4) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.4) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.4) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.0.3) lib/quiet_assets.rb:23:in `call_with_quiet_assets'
actionpack (4.1.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.1.4) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.1.4) lib/rails/engine.rb:514:in `call'
railties (4.1.4) lib/rails/application.rb:144:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
unicorn (4.8.3) lib/unicorn/http_server.rb:576:in `process_client'
unicorn (4.8.3) lib/unicorn/http_server.rb:670:in `worker_loop'
newrelic_rpm (3.7.3.204) lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:22:in `block (4 levels) in <top (required)>'
unicorn (4.8.3) lib/unicorn/http_server.rb:525:in `spawn_missing_workers'
unicorn (4.8.3) lib/unicorn/http_server.rb:140:in `start'
unicorn-rails (2.2.0) lib/unicorn_rails.rb:33:in `run'
rack (1.5.2) lib/rack/server.rb:264:in `start'
railties (4.1.4) lib/rails/commands/server.rb:69:in `start'
railties (4.1.4) lib/rails/commands/commands_tasks.rb:81:in `block in server'
railties (4.1.4) lib/rails/commands/commands_tasks.rb:76:in `server'
railties (4.1.4) lib/rails/commands/commands_tasks.rb:40:in `run_command!'
railties (4.1.4) lib/rails/commands.rb:17:in `<top (required)>'
() Users/erikchan/Workspace/productchamp/bin/rails:8:in `<top (required)>'
spring (1.1.3) lib/spring/client/rails.rb:27:in `call'
spring (1.1.3) lib/spring/client/command.rb:7:in `call'
spring (1.1.3) lib/spring/client.rb:26:in `run'
spring (1.1.3) bin/spring:48:in `<top (required)>'
spring (1.1.3) lib/spring/binstub.rb:11:in `<top (required)>'
() Users/erikchan/Workspace/productchamp/bin/spring:16:in `<top (required)>'
() rails:3:in `<main>'
I know it's been a long time, but if anyone is still wondering about the answer then please find it below:
It seems the error was due to a bug in the demo app, this was fixed and was committed to the demo app. Please find the answer in the below link (it is the same link as mentioned above)
https://github.com/jhund/filterrific/issues/26
The following:
= link_to 'New', new_photo_path
raises:
undefined method `stringify_keys' for "/photos/new":String
However, this works:
= link_to new_photo_path do
= 'New'
Why is that?
Full trace:
NoMethodError - undefined method `stringify_keys' for "/photos/new":String:
actionview (4.1.5) lib/action_view/helpers/url_helper.rb:562:in `convert_options_to_data_attributes'
actionview (4.1.5) lib/action_view/helpers/url_helper.rb:179:in `link_to'
app/views/layouts/application.html.slim:12:in `_app_views_layouts_application_html_slim___3879750285739199800_69912892033540'
actionview (4.1.5) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.5) lib/active_support/notifications.rb:161:in `instrument'
actionview (4.1.5) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.5) lib/action_view/template.rb:143:in `render'
actionview (4.1.5) lib/action_view/renderer/template_renderer.rb:67:in `render_with_layout'
actionview (4.1.5) lib/action_view/renderer/template_renderer.rb:53:in `render_template'
actionview (4.1.5) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionview (4.1.5) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (4.1.5) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (4.1.5) lib/action_view/rendering.rb:99:in `_render_template'
actionpack (4.1.5) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (4.1.5) lib/action_view/rendering.rb:82:in `render_to_body'
actionpack (4.1.5) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
actionpack (4.1.5) lib/action_controller/metal/renderers.rb:32:in `render_to_body'
actionpack (4.1.5) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (4.1.5) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.1.5) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.1.5) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/home/user/.rbenv/versions/2.1.2/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
activesupport (4.1.5) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.1.5) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.1.5) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.1.5) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.1.5) lib/action_controller/metal/instrumentation.rb:40:in `render'
actionpack (4.1.5) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (4.1.5) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (4.1.5) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.1.5) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.1.5) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.1.5) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.5) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.5) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.5) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.5) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.5) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.5) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.5) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.5) lib/active_support/callbacks.rb:86:in `run_callbacks'
actionpack (4.1.5) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.1.5) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.1.5) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.1.5) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.5) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.5) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.1.5) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.1.5) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.1.5) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.1.5) lib/abstract_controller/base.rb:136:in `process'
actionview (4.1.5) lib/action_view/rendering.rb:30:in `process'
actionpack (4.1.5) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.1.5) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.1.5) lib/action_controller/metal.rb:232:in `block in action'
actionpack (4.1.5) lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
actionpack (4.1.5) lib/action_dispatch/routing/route_set.rb:50:in `call'
actionpack (4.1.5) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.1.5) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.5) lib/action_dispatch/routing/route_set.rb:678:in `call'
dragonfly (1.0.7) lib/dragonfly/middleware.rb:14:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.1.5) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.1.5) lib/action_dispatch/middleware/flash.rb:254:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.1.5) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.1.5) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.1.5) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
activerecord (4.1.5) lib/active_record/migration.rb:380:in `call'
actionpack (4.1.5) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.5) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.5) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.1.5) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.1.5) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
better_errors (2.0.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (2.0.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (2.0.0) lib/better_errors/middleware.rb:57:in `call'
actionpack (4.1.5) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.1.5) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.5) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.5) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.5) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.5) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.5) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.5) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.0.3) lib/quiet_assets.rb:23:in `call_with_quiet_assets'
actionpack (4.1.5) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.5) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
dragonfly (1.0.7) lib/dragonfly/cookie_monster.rb:9:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.1.5) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.1.5) lib/rails/engine.rb:514:in `call'
railties (4.1.5) lib/rails/application.rb:144:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
thin (1.6.2) lib/thin/connection.rb:86:in `block in pre_process'
thin (1.6.2) lib/thin/connection.rb:84:in `pre_process'
thin (1.6.2) lib/thin/connection.rb:53:in `process'
thin (1.6.2) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
thin (1.6.2) lib/thin/backends/base.rb:73:in `start'
thin (1.6.2) lib/thin/server.rb:162:in `start'
rack (1.5.2) lib/rack/handler/thin.rb:16:in `run'
rack (1.5.2) lib/rack/server.rb:264:in `start'
railties (4.1.5) lib/rails/commands/server.rb:69:in `start'
railties (4.1.5) lib/rails/commands/commands_tasks.rb:81:in `block in server'
railties (4.1.5) lib/rails/commands/commands_tasks.rb:76:in `server'
railties (4.1.5) lib/rails/commands/commands_tasks.rb:40:in `run_command!'
railties (4.1.5) lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:8:in `<top (required)>'
spring (1.1.3) lib/spring/client/rails.rb:27:in `call'
spring (1.1.3) lib/spring/client/command.rb:7:in `call'
spring (1.1.3) lib/spring/client.rb:26:in `run'
spring (1.1.3) bin/spring:48:in `<top (required)>'
spring (1.1.3) lib/spring/binstub.rb:11:in `<top (required)>'
/home/user/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
bin/spring:16:in `<top (required)>'
bin/rails:3:in `<main>'
Beginning of application.html.slim:
html lang='en'
head
meta charset='UTF-8'
title Some title
= stylesheet_link_tag 'application'
= csrf_meta_tags
body
#page-wrapper
#page
header
= link_to new_photo_path, class: 'upload-button-icon main-nav-logo' do
= ''
I updated from RoR 4.0.4 to 4.1.1 to apply the latest security patch and it appears pg_search broke.
Here's a error:
PG::SyntaxError: ERROR: syntax error at or near "AS"
LINE 1: ...sh', ''' ' || unaccent('banner') || ' ''')), 0))) AS pg_sear...
I'm searching via ajax but i don't think that is the issue based on the output above. I'm also using will_paginate but the branch I'm using is supposed to fix previous issues with rails 4.1.x and pg_search.
gem 'will_paginate', :git => 'https://github.com/nazgum/will_paginate.git' #until rails 4.1 will_paginate fixed
This is the code model where i'm executing the search:
include PgSearch
pg_search_scope :search, against: [:title, :body],
using: {tsearch: {dictionary: "english"}},
ignoring: :accents
def self.text_search(query)
if query.present?
search(query)
else
scoped
end
end
Everything was working prior to the RoR version bump - hoping someone might have some advice.
Here's the full stacktrace:
: SELECT COUNT("photos".*, ((ts_rank((to_tsvector('english', unaccent(coalesce("photos"."description"::text, ''))) || to_tsvector('english', unaccent(coalesce(pg_search_3b58f11462e6f0086ceffb.pg_search_dc60169d7766a303bd09de::text, '')))), (to_tsquery('english', ''' ' || unaccent('"banner"') || ' ''')), 0))) AS pg_search_rank) FROM "photos" LEFT OUTER JOIN (SELECT "photos"."id" AS id, string_agg("products"."name"::text, ' ') AS pg_search_dc60169d7766a303bd09de FROM "photos" INNER JOIN "products" ON "products"."id" = "photos"."product_id" GROUP BY "photos"."id") pg_search_3b58f11462e6f0086ceffb ON pg_search_3b58f11462e6f0086ceffb.id = "photos"."id" WHERE "photos"."placement" = 'showcase' AND (((to_tsvector('english', unaccent(coalesce("photos"."description"::text, ''))) || to_tsvector('english', unaccent(coalesce(pg_search_3b58f11462e6f0086ceffb.pg_search_dc60169d7766a303bd09de::text, '')))) ## (to_tsquery('english', ''' ' || unaccent('"banner"') || ' ''')))) AND "photos"."is_active" = 't':
activerecord (4.1.1) lib/active_record/connection_adapters/abstract_adapter.rb:362:in `translate_exception_class'
activerecord (4.1.1) lib/active_record/connection_adapters/abstract_adapter.rb:375:in `rescue in log'
activerecord (4.1.1) lib/active_record/connection_adapters/abstract_adapter.rb:373:in `log'
activerecord (4.1.1) lib/active_record/connection_adapters/postgresql_adapter.rb:815:in `exec_no_cache'
activerecord (4.1.1) lib/active_record/connection_adapters/postgresql/database_statements.rb:137:in `exec_query'
activerecord (4.1.1) lib/active_record/connection_adapters/postgresql_adapter.rb:947:in `select'
activerecord (4.1.1) lib/active_record/connection_adapters/abstract/database_statements.rb:31:in `select_all'
activerecord (4.1.1) lib/active_record/connection_adapters/abstract/query_cache.rb:67:in `block in select_all'
activerecord (4.1.1) lib/active_record/connection_adapters/abstract/query_cache.rb:82:in `cache_sql'
activerecord (4.1.1) lib/active_record/connection_adapters/abstract/query_cache.rb:67:in `select_all'
activerecord (4.1.1) lib/active_record/relation/calculations.rb:254:in `execute_simple_calculation'
activerecord (4.1.1) lib/active_record/relation/calculations.rb:216:in `perform_calculation'
activerecord (4.1.1) lib/active_record/relation/calculations.rb:111:in `calculate'
activerecord (4.1.1) lib/active_record/relation/calculations.rb:26:in `count'
app/views/showcases/_index.html.haml:1:in `_app_views_showcases__index_html_haml__780171647705973812_70320535206900'
actionview (4.1.1) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.1) lib/active_support/notifications.rb:161:in `instrument'
actionview (4.1.1) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.1) lib/action_view/template.rb:143:in `render'
actionview (4.1.1) lib/action_view/renderer/partial_renderer.rb:306:in `render_partial'
actionview (4.1.1) lib/action_view/renderer/partial_renderer.rb:279:in `block in render'
actionview (4.1.1) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.1.1) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.1) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.1) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionview (4.1.1) lib/action_view/renderer/partial_renderer.rb:278:in `render'
actionview (4.1.1) lib/action_view/renderer/renderer.rb:47:in `render_partial'
actionview (4.1.1) lib/action_view/renderer/renderer.rb:21:in `render'
actionview (4.1.1) lib/action_view/helpers/rendering_helper.rb:32:in `render'
haml (4.0.5) lib/haml/helpers/action_view_mods.rb:12:in `render_with_haml'
app/views/showcases/index.js.erb:4:in `_app_views_showcases_index_js_erb__1635704546300671617_70320482208180'
actionview (4.1.1) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.1) lib/active_support/notifications.rb:161:in `instrument'
actionview (4.1.1) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.1) lib/action_view/template.rb:143:in `render'
actionview (4.1.1) lib/action_view/renderer/template_renderer.rb:55:in `block (2 levels) in render_template'
actionview (4.1.1) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.1.1) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.1) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.1) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionview (4.1.1) lib/action_view/renderer/template_renderer.rb:54:in `block in render_template'
actionview (4.1.1) lib/action_view/renderer/template_renderer.rb:62:in `render_with_layout'
actionview (4.1.1) lib/action_view/renderer/template_renderer.rb:53:in `render_template'
actionview (4.1.1) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionview (4.1.1) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (4.1.1) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (4.1.1) lib/action_view/rendering.rb:99:in `_render_template'
actionpack (4.1.1) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (4.1.1) lib/action_view/rendering.rb:82:in `render_to_body'
actionpack (4.1.1) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
actionpack (4.1.1) lib/action_controller/metal/renderers.rb:32:in `render_to_body'
actionpack (4.1.1) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (4.1.1) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.1.1) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.1.1) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/Users/bret/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
activesupport (4.1.1) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.1.1) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.1.1) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.1.1) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.1.1) lib/action_controller/metal/instrumentation.rb:40:in `render'
actionpack (4.1.1) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (4.1.1) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (4.1.1) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.1.1) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.1.1) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.1.1) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.1) lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
activesupport (4.1.1) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.1) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.1) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.1) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.1) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.1) lib/active_support/callbacks.rb:86:in `run_callbacks'
actionpack (4.1.1) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.1.1) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.1.1) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.1.1) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.1) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.1.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.1.1) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.1.1) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.1.1) lib/abstract_controller/base.rb:136:in `process'
actionview (4.1.1) lib/action_view/rendering.rb:30:in `process'
actionpack (4.1.1) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.1.1) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.1.1) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.1.1) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.1.1) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.1.1) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.1.1) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.1) lib/action_dispatch/routing/route_set.rb:676:in `call'
omniauth (1.2.1) lib/omniauth/strategy.rb:404:in `call_app!'
omniauth-identity (1.1.1) lib/omniauth/strategies/identity.rb:43:in `other_phase'
omniauth (1.2.1) lib/omniauth/strategy.rb:185:in `call!'
omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.2.1) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.2.1) lib/omniauth/strategy.rb:186:in `call!'
omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
omniauth (1.2.1) lib/omniauth/builder.rb:59:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/flash.rb:254:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.1.1) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.1.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.1) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
better_errors (1.1.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (1.1.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (1.1.0) lib/better_errors/middleware.rb:56:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.1.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.1) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.1) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.1) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.1) lib/rails/rack/logger.rb:20:in `call'
quiet_assets (1.0.2) lib/quiet_assets.rb:18:in `call_with_quiet_assets'
actionpack (4.1.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.1) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
sentry-raven (0.8.0) lib/raven/rack.rb:47:in `call'
railties (4.1.1) lib/rails/engine.rb:514:in `call'
railties (4.1.1) lib/rails/application.rb:144:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
railties (4.1.1) lib/rails/rack/debugger.rb:20:in `call'
thin (1.6.2) lib/thin/connection.rb:86:in `block in pre_process'
thin (1.6.2) lib/thin/connection.rb:84:in `pre_process'
thin (1.6.2) lib/thin/connection.rb:53:in `process'
thin (1.6.2) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
thin (1.6.2) lib/thin/backends/base.rb:73:in `start'
thin (1.6.2) lib/thin/server.rb:162:in `start'
rack (1.5.2) lib/rack/handler/thin.rb:16:in `run'
rack (1.5.2) lib/rack/server.rb:264:in `start'
railties (4.1.1) lib/rails/commands/server.rb:69:in `start'
railties (4.1.1) lib/rails/commands/commands_tasks.rb:81:in `block in server'
railties (4.1.1) lib/rails/commands/commands_tasks.rb:76:in `server'
railties (4.1.1) lib/rails/commands/commands_tasks.rb:40:in `run_command!'
railties (4.1.1) lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:4:in `<main>'
#supports.count(:all) should work, the #supports.count syntax got deprecated in rails 4.1.1
There is a good conversation here to clarify the problem.
This is weird - when i call
=#supports.count
the error is generated but it is a valid object. It's a bit hacky but this is working for now:
=#supports.to_a.count