undefined method `default_locale=' for nil:NilClass - ruby-on-rails

I'm trying to internacionalize my application made with devise, but i'm struggling in some points. I've installe the i18n gem and created the devise.pt-BR.yml file and wrote inside application.rb
config.i18n.default_locale = :'pt-BR'
Ok, but when i try to anything inside my application, i get the following error message:
undefined method `default_locale=' for nil:NilClass
Rails.root: /home/ubuntu/workspace/aqueleprojetoprivate/medicos
Application Trace | Framework Trace | Full Trace
app/controllers/application_controller.rb:8:in
<class:ApplicationController>'
app/controllers/application_controller.rb:1:in'
activesupport (4.2.4) lib/active_support/dependencies.rb:457:in load'
activesupport (4.2.4) lib/active_support/dependencies.rb:457:inblock
in load_file' activesupport (4.2.4)
lib/active_support/dependencies.rb:647:in new_constants_in'
activesupport (4.2.4) lib/active_support/dependencies.rb:456:in
load_file' activesupport (4.2.4)
lib/active_support/dependencies.rb:354:in require_or_load'
activesupport (4.2.4) lib/active_support/dependencies.rb:494:in
load_missing_constant' activesupport (4.2.4)
lib/active_support/dependencies.rb:184:in const_missing'
app/controllers/home_controller.rb:1:in'
activesupport (4.2.4) lib/active_support/dependencies.rb:457:in load'
activesupport (4.2.4) lib/active_support/dependencies.rb:457:inblock
in load_file' activesupport (4.2.4)
lib/active_support/dependencies.rb:647:in new_constants_in'
activesupport (4.2.4) lib/active_support/dependencies.rb:456:in
load_file' activesupport (4.2.4)
lib/active_support/dependencies.rb:354:in require_or_load'
activesupport (4.2.4) lib/active_support/dependencies.rb:494:in
load_missing_constant' activesupport (4.2.4)
lib/active_support/dependencies.rb:184:in const_missing'
activesupport (4.2.4) lib/active_support/inflector/methods.rb:261:in
const_get' activesupport (4.2.4)
lib/active_support/inflector/methods.rb:261:in block in constantize'
activesupport (4.2.4) lib/active_support/inflector/methods.rb:259:in
each' activesupport (4.2.4)
lib/active_support/inflector/methods.rb:259:in inject' activesupport
(4.2.4) lib/active_support/inflector/methods.rb:259:inconstantize'
activesupport (4.2.4) lib/active_support/dependencies.rb:566:in get'
activesupport (4.2.4) lib/active_support/dependencies.rb:597:in
constantize' actionpack (4.2.4)
lib/action_dispatch/routing/route_set.rb:72:in controller_reference'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:62:in
controller' actionpack (4.2.4)
lib/action_dispatch/routing/route_set.rb:41:in serve' actionpack
(4.2.4) lib/action_dispatch/journey/router.rb:43:inblock in serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in each'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:inserve'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:821:in
call' warden (1.2.4) lib/warden/manager.rb:35:inblock in call'
warden (1.2.4) lib/warden/manager.rb:34:in catch' warden (1.2.4)
lib/warden/manager.rb:34:incall' rack (1.6.4) lib/rack/etag.rb:24:in
call' rack (1.6.4) lib/rack/conditionalget.rb:25:incall' rack
(1.6.4) lib/rack/head.rb:13:in call' actionpack (4.2.4)
lib/action_dispatch/middleware/params_parser.rb:27:incall'
actionpack (4.2.4) lib/action_dispatch/middleware/flash.rb:260:in
call' rack (1.6.4) lib/rack/session/abstract/id.rb:225:incontext'
rack (1.6.4) lib/rack/session/abstract/id.rb:220:in call' actionpack
(4.2.4) lib/action_dispatch/middleware/cookies.rb:560:incall'
activerecord (4.2.4) lib/active_record/query_cache.rb:36:in call'
activerecord (4.2.4)
lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in
call' activerecord (4.2.4) lib/active_record/migration.rb:377:in
call' actionpack (4.2.4)
lib/action_dispatch/middleware/callbacks.rb:29:inblock in call'
activesupport (4.2.4) lib/active_support/callbacks.rb:88:in
__run_callbacks__' activesupport (4.2.4)
lib/active_support/callbacks.rb:778:in_run_call_callbacks'
activesupport (4.2.4) lib/active_support/callbacks.rb:81:in
run_callbacks' actionpack (4.2.4)
lib/action_dispatch/middleware/callbacks.rb:27:incall' actionpack
(4.2.4) lib/action_dispatch/middleware/reloader.rb:73:in call'
actionpack (4.2.4) lib/action_dispatch/middleware/remote_ip.rb:78:in
call' actionpack (4.2.4)
lib/action_dispatch/middleware/debug_exceptions.rb:17:in call'
web-console (2.2.1) lib/web_console/middleware.rb:31:incall'
actionpack (4.2.4)
lib/action_dispatch/middleware/show_exceptions.rb:30:in call'
railties (4.2.4) lib/rails/rack/logger.rb:38:incall_app' railties
(4.2.4) lib/rails/rack/logger.rb:20:in block in call' activesupport
(4.2.4) lib/active_support/tagged_logging.rb:68:inblock in tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in
tagged' activesupport (4.2.4)
lib/active_support/tagged_logging.rb:68:intagged' railties (4.2.4)
lib/rails/rack/logger.rb:20:in call' actionpack (4.2.4)
lib/action_dispatch/middleware/request_id.rb:21:incall' rack (1.6.4)
lib/rack/methodoverride.rb:22:in call' rack (1.6.4)
lib/rack/runtime.rb:18:incall' activesupport (4.2.4)
lib/active_support/cache/strategy/local_cache_middleware.rb:28:in
call' rack (1.6.4) lib/rack/lock.rb:17:incall' actionpack (4.2.4)
lib/action_dispatch/middleware/static.rb:116:in call' rack (1.6.4)
lib/rack/sendfile.rb:113:incall' railties (4.2.4)
lib/rails/engine.rb:518:in call' railties (4.2.4)
lib/rails/application.rb:165:incall' rack (1.6.4)
lib/rack/lock.rb:17:in call' rack (1.6.4)
lib/rack/content_length.rb:15:incall' rack (1.6.4)
lib/rack/handler/webrick.rb:88:in service'
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in
service'
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in
run'
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in
block in start_thread'
How do i fix it?

It looks like your Rails is version 4.2.
If that is the case, you should not use config.i18n but I18n.
See here:
# in config/initializers/locale.rb
# tell the I18n library where to find your translations
I18n.load_path += Dir[Rails.root.join('lib', 'locale', '*.{rb,yml}')]
# set default locale to something other than :en
I18n.default_locale = :pt

Related

MissingHelperError in Rails::WelcomeController#index

I am getting the following error after I try creating a new Ruby app with rails new app-name-1. When I first run the server with rails s I get this:
AbstractController::Helpers::MissingHelperError in
Rails::WelcomeController#index Missing helper file
helpers/c:/users/aaa/google drive/web
apps/fake_orders_3/app/helpers/application_helper.rb_helper.rb
Rails.root: C:/users/aaa/google drive/web apps/fake-orders-3
actionpack (4.2.6) lib/abstract_controller/helpers.rb:151:in `rescue in block in modules_for_helpers' actionpack (4.2.6) lib/abstract_controller/helpers.rb:148:in `block in modules_for_helpers' actionpack (4.2.6) lib/abstract_controller/helpers.rb:144:in `map!' actionpack (4.2.6) lib/abstract_controller/helpers.rb:144:in `modules_for_helpers' actionpack (4.2.6) lib/action_controller/metal/helpers.rb:93:in `modules_for_helpers' actionpack (4.2.6)
lib/abstract_controller/helpers.rb:108:in `helper' actionpack (4.2.6) lib/action_controller/railties/helpers.rb:17:in `inherited' railties (4.2.6) lib/rails/application_controller.rb:1:in `<top (required)>' activesupport (4.2.6) lib/active_support/dependencies.rb:274:in `require' activesupport (4.2.6) lib/active_support/dependencies.rb:274:in `block in require' activesupport (4.2.6) lib/active_support/dependencies.rb:240:in `load_dependency' activesupport (4.2.6) lib/active_support/dependencies.rb:274:in `require' railties (4.2.6) lib/rails/welcome_controller.rb:1:in `<top (required)>' activesupport (4.2.6)
lib/active_support/inflector/methods.rb:263:in `const_get' activesupport (4.2.6) lib/active_support/inflector/methods.rb:263:in `block in constantize' activesupport (4.2.6) lib/active_support/inflector/methods.rb:259:in `each' activesupport (4.2.6) lib/active_support/inflector/methods.rb:259:in `inject' activesupport (4.2.6) lib/active_support/inflector/methods.rb:259:in `constantize' activesupport (4.2.6) lib/active_support/dependencies.rb:566:in `get' activesupport (4.2.6) lib/active_support/dependencies.rb:597:in `constantize' actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:70:in `controller_reference' actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:60:in `controller' actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:39:in `serve' actionpack (4.2.6)
lib/action_dispatch/journey/router.rb:43:in `block in serve' actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `each' actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `serve' actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:817:in `call' rack (1.6.4) lib/rack/etag.rb:24:in `call' rack (1.6.4) lib/rack/conditionalget.rb:25:in `call' rack (1.6.4) lib/rack/head.rb:13:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/flash.rb:260:in `call' rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context' rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/cookies.rb:560:in `call' activerecord (4.2.6) lib/active_record/query_cache.rb:36:in `call' activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call' activerecord (4.2.6) lib/active_record/migration.rb:377:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' activesupport (4.2.6) lib/active_support/callbacks.rb:88:in `__run_callbacks__' activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_call_callbacks' activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks' actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/reloader.rb:73:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/remote_ip.rb:78:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call' web-console (2.3.0) lib/web_console/middleware.rb:28:in `block in call' web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch' web-console (2.3.0) lib/web_console/middleware.rb:18:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' railties (4.2.6) lib/
rails/rack/logger.rb:38:in `call_app' railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call' activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged' activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged' activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged' railties (4.2.6) lib/rails/rack/logger.rb:20:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call' rack (1.6.4) lib/rack/methodoverride.rb:22:in `call' rack (1.6.4) lib/rack/runtime.rb:18:in `call' activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' rack (1.6.4) lib/rack/lock.rb:17:in `call' actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call' rack (1.6.4) lib/rack/sendfile.rb:113:in `call' railties (4.2.6) lib/rails/engine.rb:518:in `call' railties (4.2.6) lib/rails/application.rb:165:in `call' rack (1.6.4) lib/rack/lock.rb:17:in `call' rack (1.6.4) lib/rack/content_length.rb:15:in `call' rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service' C:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service' C:/Ruby22/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run' C:/Ruby22/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread' This error occurred while loading the following files: rails/application_controller

unable to integrate open_id_authentication with ActionController::API

I am buidling rails application with my ApplicationController building on ActionController::API. I tried integrating open_id_authentication gem and it worked fine if my ApplicationController was built using ActionController::Base but threw error with API. I tried including middleware in following manners
Method 1. Add middleware in initilaizer
`config/initializers/openid.rb`
require 'open_id_authentication'
Rails.application.config do
config.middleware.use OpenIdAuthentication
config.after_initialize do
OpenID::Util.logger = Rails.logger
ActionController::API.send :include, OpenIdAuthentication::ControllerMethods
end
end
but got following error stack with it:
NoMethodError - undefined method `authenticate_with_open_id' for #:
app/controllers/v2/sessions_controller.rb:45:in `accounts_authentication'
app/controllers/v2/sessions_controller.rb:17:in `login'
actionpack (4.2.6) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.2.6) lib/abstract_controller/base.rb:198:in `process_action'
actionpack (4.2.6) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.2.6) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.2.6) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.6) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
activesupport (4.2.6) lib/active_support/callbacks.rb:505:in `call'
activesupport (4.2.6) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.6) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.2.6) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (4.2.6) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.6) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.6) lib/active_support/notifications.rb:164:in `instrument'
actionpack (4.2.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
activerecord (4.2.6) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.6) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.6) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.6) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.6) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.6) lib/action_controller/metal.rb:237:in `block in action'
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:43:in `serve'
actionpack (4.2.6) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.6) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.6) lib/action_dispatch/routing/route_set.rb:817:in `call'
rack-openid (1.4.2) lib/rack/openid.rb:98:in `call'
rack (1.6.4) lib/rack/etag.rb:24:in `call'
rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.4) lib/rack/head.rb:13:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.6) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
activerecord (4.2.6) lib/active_record/migration.rb:377:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.6) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.6) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.6) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
web-console (2.3.0) lib/web_console/middleware.rb:20:in `block in call'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.6) lib/action_dispatch/middleware/static.rb:120:in `call'
railties (4.2.6) lib/rails/engine.rb:518:in `call'
railties (4.2.6) lib/rails/application.rb:165:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
/usr/local/rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service'
/usr/local/rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run'
Method 2. Add middleware via config/environment/development.rb
require 'open_id_authentication'
Rails.application.configure do
config.middleware.use OpenIdAuthentication::Middleware
end
It gave the same error stack
Please help me with the solution to include middleware for open_id_authentication in ActionController::API
I checked the middlewares included using command rake middleware and I found that OpenIdAuthentication::Middleware was already included. Going through rails-api README, I added config.middleware.use Rack::MethodOverride to config/environments/development.rb.
Now, to access open_id_authentication gem methods, include it in whichever module/controller you are using via include OpenIdAuthentication::ControllerMethods as ControllerMethods module has all the methods being used.

Rails fetch outlook mail

I am building my rails application in that I am trying to fetch outlook mails using viewpointbut unable to do so.I am getting this error when I am trying to access folder .
Unknown key: version = 1
Unknown key: version = 1
undefined method `[]' for nil:NilClass
At this line: #folders = cli.folders
outlooks_controller:
require 'viewpoint'
include Viewpoint::EWS
class OutlooksController < ApplicationController
def index
endpoint = 'https://login.live.com/login.srf?wa=wsignin1.0&ct=1409066173&rver=6.1.6206.0&sa=1&ntprob=-1&wp=MBI_SSL_SHARED&wreply=https:%2F%2Fmail.live.com%2F%3Fowa%3D1%26owasuffix%3Dowa%252f&id=64855&snsc=1&cbcxt=mail'
user = 'username'
pass = 'pass'
cli = Viewpoint::EWSClient.new endpoint, user, pass
#folders = cli.folders #<---- exception here
puts "hhhhhhhhh#{cli}"
end
end
[stacktrace]
viewpoint (1.0.0) lib/ews/soap/ews_soap_response.rb:31:in `envelope'
viewpoint (1.0.0) lib/ews/soap/ews_soap_response.rb:39:in `body'
viewpoint (1.0.0) lib/ews/soap/ews_soap_response.rb:43:in `response'
viewpoint (1.0.0) lib/ews/soap/ews_soap_response.rb:47:in `response_messages'
viewpoint (1.0.0) lib/ews/soap/ews_soap_response.rb:80:in `simplify!'
viewpoint (1.0.0) lib/ews/soap/ews_soap_response.rb:27:in `initialize'
viewpoint (1.0.0) lib/ews/soap/parsers/ews_parser.rb:32:in `new'
viewpoint (1.0.0) lib/ews/soap/parsers/ews_parser.rb:32:in `parse'
viewpoint (1.0.0) lib/ews/soap/exchange_web_service.rb:221:in `parse_soap_response'
viewpoint (1.0.0) lib/ews/connection.rb:74:in `dispatch'
viewpoint (1.0.0) lib/ews/soap/exchange_web_service.rb:212:in `do_soap_request'
viewpoint (1.0.0) lib/ews/soap/exchange_data_services.rb:503:in `find_folder'
viewpoint (1.0.0) lib/ews/folder_accessors.rb:45:in `folders'
app/controllers/outlooks_controller.rb:13:in `index'
actionpack (4.2.4) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.2.4) lib/abstract_controller/base.rb:198:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.2.4) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.2.4) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
activesupport (4.2.4) lib/active_support/callbacks.rb:505:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:505:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.4) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `instrument'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.4) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.4) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.4) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.4) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.4) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.4) lib/action_controller/metal.rb:237:in `block in action'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:76:in `call'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:76:in `dispatch'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:45:in `serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:821:in `call'
rack (1.6.4) lib/rack/etag.rb:24:in `call'
rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.4) lib/rack/head.rb:13:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.4) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
activerecord (4.2.4) lib/active_record/migration.rb:377:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.4) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
web-console (2.2.1) lib/web_console/middleware.rb:39:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/static.rb:116:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.4) lib/rails/engine.rb:518:in `call'
railties (4.2.4) lib/rails/application.rb:165:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
/home/techbirds/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/home/techbirds/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/home/techbirds/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
logging (2.0.0) lib/logging/diagnostic_context.rb:448:in `call'
logging (2.0.0) lib/logging/diagnostic_context.rb:448:in `block in create_with_logging_context'
It appears as if this is a bug in the gem itself. There's an issue opened here, where you might find more information: https://github.com/WinRb/Viewpoint/issues/166

Upgrading Rails 3.2 to Rails 4.2 getting 401 unauthorized

When I updating to from rails 3.2 to rails 4.2 the gems are all compatible for rails 4 was cross checked with this
when I run server it will throwing error as below.
Processing by HomeController#index as HTML
Completed 500 Internal Server Error in 28ms (ActiveRecord: 0.0ms)
TypeError (incompatible marshal file format (can't be read)
format version 4.8 required; 123.34 given):
activesupport (4.2.4) lib/active_support/core_ext/marshal.rb:6:in `load'
activesupport (4.2.4) lib/active_support/core_ext/marshal.rb:6:in `load_with_autoloading'
actionpack (4.2.4) lib/action_dispatch/middleware/cookies.rb:424:in `deserialize'
actionpack (4.2.4) lib/action_dispatch/middleware/cookies.rb:516:in `[]'
actionpack (4.2.4) lib/action_dispatch/middleware/session/cookie_store.rb:114:in `get_cookie'
actionpack (4.2.4) lib/action_dispatch/middleware/session/cookie_store.rb:90:in `block in unpacked_cookie_data'
actionpack (4.2.4) lib/action_dispatch/middleware/session/abstract_store.rb:51:in `stale_session_check!'
actionpack (4.2.4) lib/action_dispatch/middleware/session/cookie_store.rb:89:in `unpacked_cookie_data'
actionpack (4.2.4) lib/action_dispatch/middleware/session/cookie_store.rb:83:in `block in extract_session_id'
actionpack (4.2.4) lib/action_dispatch/middleware/session/abstract_store.rb:51:in `stale_session_check!'
actionpack (4.2.4) lib/action_dispatch/middleware/session/cookie_store.rb:82:in `extract_session_id'
actionpack (4.2.4) lib/action_dispatch/request/session.rb:49:in `block in []'
actionpack (4.2.4) lib/action_dispatch/request/session.rb:48:in `fetch'
actionpack (4.2.4) lib/action_dispatch/request/session.rb:48:in `[]'
actionpack (4.2.4) lib/action_dispatch/request/session.rb:70:in `id'
rack (1.6.4) lib/rack/session/abstract/id.rb:282:in `current_session_id'
rack (1.6.4) lib/rack/session/abstract/id.rb:288:in `session_exists?'
actionpack (4.2.4) lib/action_dispatch/request/session.rb:152:in `exists?'
actionpack (4.2.4) lib/action_dispatch/request/session.rb:172:in `load_for_read!'
actionpack (4.2.4) lib/action_dispatch/request/session.rb:89:in `[]'
warden (1.2.3) lib/warden/session_serializer.rb:30:in `fetch'
warden (1.2.3) lib/warden/proxy.rb:212:in `user'
warden (1.2.3) lib/warden/proxy.rb:318:in `_perform_authentication'
warden (1.2.3) lib/warden/proxy.rb:104:in `authenticate'
devise (3.5.2) lib/devise/controllers/helpers.rb:120:in `current_user'
activesupport (4.2.4) lib/active_support/callbacks.rb:432:in `block in make_lambda'
activesupport (4.2.4) lib/active_support/callbacks.rb:290:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:290:in `block (2 levels) in halting_and_conditional'
activesupport (4.2.4) lib/active_support/callbacks.rb:290:in `each'
activesupport (4.2.4) lib/active_support/callbacks.rb:290:in `all?'
activesupport (4.2.4) lib/active_support/callbacks.rb:290:in `block in halting_and_conditional'
activesupport (4.2.4) lib/active_support/callbacks.rb:497:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:497:in `block in around'
activesupport (4.2.4) lib/active_support/callbacks.rb:505:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:505:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.4) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `instrument'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.4) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.4) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.4) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.4) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.4) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.4) lib/action_controller/metal.rb:237:in `block in action'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:76:in `call'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:76:in `dispatch'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:45:in `serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:821:in `call'
client_side_validations (3.2.7) lib/client_side_validations/middleware.rb:17: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.6.4) lib/rack/etag.rb:24:in `call'
rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.4) lib/rack/head.rb:13:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.4) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
activerecord (4.2.4) lib/active_record/migration.rb:377:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.4) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.4) lib/rails/engine.rb:518:in `call'
railties (4.2.4) lib/rails/application.rb:165:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
thin (1.6.4) lib/thin/connection.rb:86:in `block in pre_process'
thin (1.6.4) lib/thin/connection.rb:84:in `catch'
thin (1.6.4) lib/thin/connection.rb:84:in `pre_process'
thin (1.6.4) lib/thin/connection.rb:53:in `process'
thin (1.6.4) lib/thin/connection.rb:39:in `receive_data'
eventmachine (1.0.8) lib/eventmachine.rb:193:in `run_machine'
eventmachine (1.0.8) lib/eventmachine.rb:193:in `run'
thin (1.6.4) lib/thin/backends/base.rb:73:in `start'
thin (1.6.4) lib/thin/server.rb:162:in `start'
rack (1.6.4) lib/rack/handler/thin.rb:19:in `run'
rack (1.6.4) lib/rack/server.rb:286:in `start'
railties (4.2.4) lib/rails/commands/server.rb:80:in `start'
railties (4.2.4) lib/rails/commands/commands_tasks.rb:80:in `block in server'
railties (4.2.4) lib/rails/commands/commands_tasks.rb:75:in `tap'
railties (4.2.4) lib/rails/commands/commands_tasks.rb:75:in `server'
railties (4.2.4) lib/rails/commands/commands_tasks.rb:39:in `run_command!'
railties (4.2.4) lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Is something missing for cookies or session settings or any changes required for devise?
I am facing different issue as well
Rails 4 upgrade JSON::ParseError for old sessions
Ruby on Rails TypeError
But no luck I had changed secret token.
It seem to be a checksum verification error. And in the callstack it comes just after CookieStore middleware. I'd try the following:
Empty cookies and cache in my web browser
If using server side cookie store: empty its storage (ex: empty the sessions database table when using activerecord-session_store)
Clean the content of my_app/tmp directory with rake tmp:clear
i had the same issue when i upgraded from Rails 3.2.16 to Rails 4.2.0 and it was assets problem try do the following:
bundle exec rake assets:clean
bundle exec rake assets:precompile

Shoppe and kaminari - undefined method `entry_name' for #<ActiveRecord::Relation []> for #orders

I've been working with the shoppe gem, and I'm currently completely stumped by an error I'm getting when I'm opening up the orders page of the admin panel.
I'm using version 1.0.7 because product variants broke on the subsequent ones. Everything was working completely fine until I merged with a different branch in my repo, and now when I try to access the orders page of the admin panel this happens:
ActionView::Template::Error (undefined method `entry_name' for #<ActiveRecord::Relation []>):
6: = link_to t('shoppe.orders.search_orders'), '#', :class => 'button', :rel => 'searchOrders'
7: %h2.orders
8: = t('shoppe.orders.orders')
9: %span= page_entries_info #orders
10:
11: = render 'search_form'
12:
activerecord (4.2.4) lib/active_record/relation/delegation.rb:136:in `method_missing'
activerecord (4.2.4) lib/active_record/relation/delegation.rb:99:in `method_missing'
kaminari (0.16.3) lib/kaminari/helpers/action_view_extension.rb:92:in `page_entries_info'
shoppe (1.0.7) app/views/shoppe/orders/index.html.haml:9:in `block in ___sers_aur______rvm_gems_ruby_______gems_shoppe_______app_views_shoppe_orders_index_html_haml__4424402014120534252_70189058436720'
haml (4.0.7) lib/haml/helpers.rb:368:in `call'
haml (4.0.7) lib/haml/helpers.rb:368:in `block in capture_haml'
haml (4.0.7) lib/haml/helpers.rb:608:in `with_haml_buffer'
haml (4.0.7) lib/haml/helpers.rb:364:in `capture_haml'
haml (4.0.7) lib/haml/helpers/xss_mods.rb:61:in `capture_haml_with_haml_xss'
haml (4.0.7) lib/haml/helpers/action_view_mods.rb:45:in `capture_with_haml'
actionview (4.2.4) lib/action_view/helpers/capture_helper.rb:152:in `content_for'
shoppe (1.0.7) app/views/shoppe/orders/index.html.haml:3:in `___sers_aur______rvm_gems_ruby_______gems_shoppe_______app_views_shoppe_orders_index_html_haml__4424402014120534252_70189058436720'
actionview (4.2.4) lib/action_view/template.rb:145:in `block in render'
activesupport (4.2.4) lib/active_support/notifications.rb:166:in `instrument'
actionview (4.2.4) lib/action_view/template.rb:333:in `instrument'
actionview (4.2.4) lib/action_view/template.rb:143:in `render'
actionview (4.2.4) lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
actionview (4.2.4) lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `instrument'
actionview (4.2.4) lib/action_view/renderer/abstract_renderer.rb:39:in `instrument'
actionview (4.2.4) lib/action_view/renderer/template_renderer.rb:53:in `block in render_template'
actionview (4.2.4) lib/action_view/renderer/template_renderer.rb:61:in `render_with_layout'
actionview (4.2.4) lib/action_view/renderer/template_renderer.rb:52:in `render_template'
actionview (4.2.4) lib/action_view/renderer/template_renderer.rb:14:in `render'
actionview (4.2.4) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (4.2.4) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (4.2.4) lib/action_view/rendering.rb:100:in `_render_template'
actionpack (4.2.4) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (4.2.4) lib/action_view/rendering.rb:83:in `render_to_body'
actionpack (4.2.4) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
actionpack (4.2.4) lib/action_controller/metal/renderers.rb:37:in `render_to_body'
actionpack (4.2.4) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (4.2.4) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
activesupport (4.2.4) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/Users/aur2103/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/benchmark.rb:303:in `realtime'
activesupport (4.2.4) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
activerecord (4.2.4) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:43:in `render'
actionpack (4.2.4) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (4.2.4) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (4.2.4) lib/abstract_controller/base.rb:198:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.2.4) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.2.4) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:117:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
activesupport (4.2.4) lib/active_support/callbacks.rb:505:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:505:in `call'
activesupport (4.2.4) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.4) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (4.2.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.2.4) lib/active_support/notifications.rb:164:in `instrument'
actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.2.4) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
activerecord (4.2.4) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.2.4) lib/abstract_controller/base.rb:137:in `process'
actionview (4.2.4) lib/action_view/rendering.rb:30:in `process'
actionpack (4.2.4) lib/action_controller/metal.rb:196:in `dispatch'
actionpack (4.2.4) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.2.4) lib/action_controller/metal.rb:237:in `block in action'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:76:in `call'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:76:in `dispatch'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:45:in `serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:821:in `call'
railties (4.2.4) lib/rails/engine.rb:518:in `call'
railties (4.2.4) lib/rails/railtie.rb:194:in `public_send'
railties (4.2.4) lib/rails/railtie.rb:194:in `method_missing'
actionpack (4.2.4) lib/action_dispatch/routing/mapper.rb:51:in `serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:43:in `block in serve'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `each'
actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `serve'
actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:821:in `call'
shoppe (1.0.7) lib/shoppe/settings_loader.rb:10:in `call'
nifty-attachments (1.0.4) lib/nifty/attachments/middleware.rb:23: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.6.4) lib/rack/etag.rb:24:in `call'
rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
rack (1.6.4) lib/rack/head.rb:13:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/flash.rb:260:in `call'
rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/cookies.rb:560:in `call'
activerecord (4.2.4) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
activerecord (4.2.4) lib/active_record/migration.rb:377:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.4) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.4) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.4) lib/action_dispatch/middleware/static.rb:116:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.4) lib/rails/engine.rb:518:in `call'
railties (4.2.4) lib/rails/application.rb:165:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
/Users/aur2103/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/Users/aur2103/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/Users/aur2103/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
I know that this is happening in the page_entries_info method in kaminari. This one, specifically the second line within the method:
def page_entries_info(collection, options = {})
entry_name = options[:entry_name] || collection.entry_name
entry_name = entry_name.pluralize unless collection.total_count == 1
if collection.total_pages < 2
t('helpers.page_entries_info.one_page.display_entries', :entry_name => entry_name, :count => collection.total_count)
else
first = collection.offset_value + 1
last = collection.last_page? ? collection.total_count : collection.offset_value + collection.limit_value
t('helpers.page_entries_info.more_pages.display_entries', :entry_name => entry_name, :first => first, :last => last, :total => collection.total_count)
end.html_safe
end
The strange thing is, I've put in some print statements in both the functioning version and the broken version, and in BOTH of them options[:entry_name] is nil and collection.inspect prints out #<ActiveRecord::Relation []>. However, only the newly merged version throws the error. Why does #<ActiveRecord::Relation []> not have this method in only one of the branches? What could be causing this?
Are you using will_paginate or bootstrap-will_paginate ?
Please see here: https://github.com/tryshoppe/shoppe/issues/189
I will also suggest the following:
1. Kill your rails server
2. type "spring stop"
3. bundle/restart rails
I had this same issue with entry_name without using will_paginate so the second fix worked for me.
Explicitly declaring entry_name in the line that calls page_entries_info is what solved it for me.
<%= page_entries_info #orders, entry_name: "order" =>
See the solution here.

Resources