I am using the chrome extension Rails Panel in my Rails application. But it's not working properly.
Gemfile
group :development do
gem 'therubyracer', :platforms => :ruby
gem 'better_errors'
gem 'binding_of_caller'
gem 'meta_request'
end
Development log:
Errno::ENOENT - No such file or directory - /home/rahulv/sprint/S33/tmp/data/meta_request/d927421bce3c90bc465c9ceb894813ca.json:
meta_request (0.3.4) lib/meta_request/storage.rb:16:in `read'
meta_request (0.3.4) lib/meta_request/middlewares/meta_request_handler.rb:20:in `events_json'
meta_request (0.3.4) lib/meta_request/middlewares/meta_request_handler.rb:11:in `call'
pdfkit (0.5.4) lib/pdfkit/middleware.rb:16:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.5) lib/rack/etag.rb:23:in `call'
rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/cookies.rb:341:in `call'
activerecord (3.2.16) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.16) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.16) lib/active_support/callbacks.rb:405:in `_run__572592932466143201__call__1542018980761186849__callbacks'
activesupport (3.2.16) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.16) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.16) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.16) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
better_errors (2.1.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (2.1.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (2.1.0) lib/better_errors/middleware.rb:57:in `call'
rack-contrib (1.2.0) lib/rack/contrib/response_headers.rb:17:in `call'
meta_request (0.3.4) lib/meta_request/middlewares/headers.rb:16:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.16) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.16) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.16) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.16) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.16) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/static.rb:63:in `call'
railties (3.2.16) lib/rails/engine.rb:484:in `call'
railties (3.2.16) lib/rails/application.rb:231:in `call'
rack (1.4.5) lib/rack/content_length.rb:14:in `call'
railties (3.2.16) lib/rails/rack/log_tailer.rb:17: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 `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'
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.4.5) lib/rack/handler/thin.rb:13:in `run'
rack (1.4.5) lib/rack/server.rb:268:in `start'
railties (3.2.16) lib/rails/commands/server.rb:70:in `start'
railties (3.2.16) lib/rails/commands.rb:55:in `block in <top (required)>'
railties (3.2.16) lib/rails/commands.rb:50:in `<top (required)>'
script/rails:6:in `<main>'
What seems to be the issue?
I have solved the issue by following these steps:
Remove the meta_request folder inside/tmp/data/
Restart the server using rails s
Now everything works fine :)
As RailsPanel is a great tool, keep using it with the meta_request gem creating a Rails initializer in the file config/initializers/meta_request.rb with the below code:
if defined?(MetaRequest) && MetaRequest::Event.private_instance_methods(false).exclude?(:not_encodable?)
MetaRequest::Event.class_eval do
private
def json_encodable(payload)
return {} unless payload.is_a?(Hash)
transform_hash(payload, deep: true) do |hash, key, value|
if value.class.to_s == 'ActionDispatch::Http::Headers'
value = value.to_h.select { |k, _| k.upcase == k }
elsif not_encodable?(value)
value = self.class.const_get(:NOT_JSON_ENCODABLE)
end
begin
value.to_json(methods: [:duration])
new_value = value
rescue StandardError
new_value = self.class.const_get(:NOT_JSON_ENCODABLE)
end
hash[key] = new_value
end.with_indifferent_access
end
def not_encodable?(value)
(defined?(ActiveRecord) && value.is_a?(ActiveRecord::ConnectionAdapters::AbstractAdapter)) ||
(defined?(ActionDispatch) &&
(value.is_a?(ActionDispatch::Request) || value.is_a?(ActionDispatch::Response)))
end
end
end
Reference: https://github.com/dejan/rails_panel/pull/177#issuecomment-797378347
Related
I'm trying to install errbit to track bugs more easily.
I followed the Installation Instructions from:
https://github.com/errbit/errbit
and
Installed the LDAP Authentication gem:
Gemfile:
gem "devise_ldap_authenticatable", :git => "git://github.com/cschiewek/devise_ldap_authenticatable.git"
executed:
rails generate devise_ldap_authenticatable:install
So far everything went good. The Unicorn Application Server starts without any issues.
But If I login I get this message:
Problem:
Validation of User failed.
Summary:
The following errors were found: Email can't be blank, Name can't be blank
Resolution:
Try persisting the document with valid data or remove the validations.
Stack Trace:
mongoid (3.1.5) lib/mongoid/persistence.rb:335:in `fail_validate!'
mongoid (3.1.5) lib/mongoid/persistence.rb:97:in `save!'
/usr/local/lib/ruby/gems/2.1.0/bundler/gems/devise_ldap_authenticatable-350b78431dbf/lib/devise_ldap_authenticatable/model.rb:107:in `find_for_ldap_authentication'
/usr/local/lib/ruby/gems/2.1.0/bundler/gems/devise_ldap_authenticatable-350b78431dbf/lib/devise_ldap_authenticatable/strategy.rb:7:in `authenticate!'
warden (1.2.3) lib/warden/strategies/base.rb:53:in `_run!'
warden (1.2.3) lib/warden/proxy.rb:354:in `block in _run_strategies_for'
warden (1.2.3) lib/warden/proxy.rb:349:in `each'
warden (1.2.3) lib/warden/proxy.rb:349:in `_run_strategies_for'
warden (1.2.3) lib/warden/proxy.rb:319:in `_perform_authentication'
warden (1.2.3) lib/warden/proxy.rb:104:in `authenticate'
devise (3.1.1) lib/devise/controllers/helpers.rb:56:in `current_user'
devise (3.1.1) lib/devise/controllers/helpers.rb:52:in `user_signed_in?'
app/controllers/application_controller.rb:49:in `set_time_zone'
activesupport (3.2.18) lib/active_support/callbacks.rb:484:in `_run__372840598407275581__process_action__1401166438855027473__callbacks'
activesupport (3.2.18) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.18) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.18) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.18) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.18) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.18) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.18) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.18) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.18) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.18) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.18) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
actionpack (3.2.18) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.18) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.18) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.18) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.18) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.18) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.18) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.18) lib/action_dispatch/routing/route_set.rb:36:in `call'
actionpack (3.2.18) lib/action_dispatch/routing/mapper.rb:43:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.18) lib/action_dispatch/routing/route_set.rb:608:in `call'
rack-ssl-enforcer (0.2.6) lib/rack/ssl-enforcer.rb:51:in `call'
hoptoad_notifier (2.4.11) lib/hoptoad_notifier/rack.rb:27:in `call'
mongoid (3.1.5) lib/rack/mongoid/middleware/identity_map.rb:34:in `block in call'
mongoid (3.1.5) lib/mongoid/unit_of_work.rb:39:in `unit_of_work'
mongoid (3.1.5) lib/rack/mongoid/middleware/identity_map.rb:34: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'
actionpack (3.2.18) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.5) lib/rack/etag.rb:23:in `call'
rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
actionpack (3.2.18) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.18) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.18) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.18) lib/action_dispatch/middleware/cookies.rb:341:in `call'
actionpack (3.2.18) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.18) lib/active_support/callbacks.rb:405:in `_run__2041107628848191489__call__2819675434513924104__callbacks'
activesupport (3.2.18) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.18) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.18) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.18) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
rack (1.4.5) lib/rack/sendfile.rb:102:in `call'
actionpack (3.2.18) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.18) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.18) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.18) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.18) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.18) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.18) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.18) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.18) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:143:in `pass'
rack-cache (1.2) lib/rack/cache/context.rb:155:in `invalidate'
rack-cache (1.2) lib/rack/cache/context.rb:71:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
hoptoad_notifier (2.4.11) lib/hoptoad_notifier/user_informer.rb:12:in `call'
railties (3.2.18) lib/rails/engine.rb:484:in `call'
railties (3.2.18) lib/rails/application.rb:231:in `call'
railties (3.2.18) lib/rails/railtie/configurable.rb:30:in `method_missing'
rack (1.4.5) lib/rack/deflater.rb:13:in `call'
unicorn (4.6.3) lib/unicorn/http_server.rb:552:in `process_client'
unicorn (4.6.3) lib/unicorn/http_server.rb:632:in `worker_loop'
unicorn (4.6.3) lib/unicorn/http_server.rb:500:in `spawn_missing_workers'
unicorn (4.6.3) lib/unicorn/http_server.rb:142:in `start'
unicorn (4.6.3) bin/unicorn_rails:209:in `<top (required)>'
/usr/local/bin/unicorn_rails:23:in `load'
/usr/local/bin/unicorn_rails:23:in `<main>'
Request Parameters
{"utf8"=>"✓",
"authenticity_token"=>"0000000000000000000000000000000000000000",
"user"=>{"username"=>"chris",
"password"=>"[FILTERED]",
"remember_me"=>"0"}}
What did I do wrong?
Update:
It works now so far.
But I'm still gitting one more Issue:
Mongoid::Errors::Validations (
Problem:
Validation of User failed.
Summary:
The following errors were found: Name can't be blank
Resolution:
Try persisting the document with valid data or remove the validations.):
app/controllers/application_controller.rb:48:in `set_time_zone'
I tried to remove the LDAP Validation, but that also didn't work.
sorry if this answer comes too late. Here's what I did to get a working LDAP setup.
In app/models/users.rb I added the following method:
def ldap_before_save
name = Devise::LDAP::Adapter.get_ldap_param(self.username, "givenName")
surname = Devise::LDAP::Adapter.get_ldap_param(self.username, "sn")
mail = Devise::LDAP::Adapter.get_ldap_param(self.username, "mail")
self.name = (name + surname).join ' '
self.email = mail.first
end
In config/initializers/devise.rb, set the following params
config.ldap_create_user = true
config.ldap_use_admin_to_bind = true
Create a new file config/initializers/devise_ldap.rb with the following contents:
Errbit::Config.devise_modules << :ldap_authenticatable
For more details, read https://github.com/errbit/errbit#configuring-ldap-authentication
I'm in the process of upgrading a Rails 2.3 app to 3.2 - in doing so, one of the plugins I used to depend on ResourceController is no longer available in Rails 3 (at least not a good port that I've found). Thus, I've had to look to other options, each gem I've tried rc_rails and rd_resource_controller as well as inherited_resources has resulted in the same error:
Routing Error uninitialized constant [ResourceController|InheritedResources].
They are most certainly in my gemlock and I've restarted the server in testing them. It almost seems as if the gems did not install, for such an error to occur.
Here are my routes from resources :projects:
projects GET /projects(.:format) projects#index
POST /projects(.:format) projects#create
new_project GET /projects/new(.:format) projects#new
edit_project GET /projects/:id/edit(.:format) projects#edit
project GET /projects/:id(.:format) projects#show
PUT /projects/:id(.:format) projects#update
DELETE /projects/:id(.:format) projects#destroy
Here's the controller:
class ProjectsController < ResourceController::Base
#....
end
## OR
class ProjectsController < InheritedResources::Base
## ....
end
Which all result in the uninitialized constant:
Routing Error
uninitialized constant InheritedResources
Here's the traceback for the inherited resource:
Started GET "/projects/3903/edit" for 127.0.0.1 at 2014-01-30 10:17:55 -0600
ActionController::RoutingError (uninitialized constant InheritedResources):
app/controllers/projects_controller.rb:3:in `<top (required)>'
activesupport (3.2.16) lib/active_support/inflector/methods.rb:230:in `block in constantize'
activesupport (3.2.16) lib/active_support/inflector/methods.rb:229:in `each'
activesupport (3.2.16) lib/active_support/inflector/methods.rb:229:in `constantize'
actionpack (3.2.16) lib/action_dispatch/routing/route_set.rb:69:in `controller_reference'
actionpack (3.2.16) lib/action_dispatch/routing/route_set.rb:54:in `controller'
actionpack (3.2.16) lib/action_dispatch/routing/route_set.rb:32:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.16) lib/action_dispatch/routing/route_set.rb:608:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.5) lib/rack/etag.rb:23:in `call'
rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/cookies.rb:341:in `call'
activerecord (3.2.16) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.16) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.16) lib/active_support/callbacks.rb:405:in `_run__542093477292722009__call__814078438384904527__callbacks'
activesupport (3.2.16) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.16) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.16) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.16) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.16) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.16) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.16) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.16) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.16) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.16) lib/action_dispatch/middleware/static.rb:63:in `call'
railties (3.2.16) lib/rails/engine.rb:484:in `call'
railties (3.2.16) lib/rails/application.rb:231:in `call'
rack (1.4.5) lib/rack/content_length.rb:14:in `call'
railties (3.2.16) lib/rails/rack/debugger.rb:20:in `call'
railties (3.2.16) lib/rails/rack/log_tailer.rb:17:in `call'
rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
/Users/myself/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/Users/myself/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/Users/myself/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
Rendered /Users/myself/.rvm/gems/ruby-1.9.3-p448#myapp/gems/actionpack-3.2.16/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.6ms)
Here's the Gemfile and Gemfile.lock for inherited:
[myself]:myapp(upgrade/rails-3.2)$ cat Gemfile | grep inherited
gem 'inherited_resources'
[myself]:myapp(upgrade/rails-3.2)$ cat Gemfile.lock | grep inherited
inherited_resources (1.4.1)
inherited_resources
And the bundle show inherited_resources:
/Users/myself/.rvm/gems/ruby-1.9.3-p448#production/gems/inherited_resources-1.4.1
Why on earth would these not be available?
I am trying to debug an application using Ruby on Rails(3.0.8) setup in Ubuntu using RubyMine.My application is without a database.
But when i start the server i am getting an error:-
ActiveRecord::ConnectionNotEstablished
This is the full trace of the error:-
ctiverecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:404:in `retrieve_connection'
activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_specification.rb:170:in `retrieve_connection'
activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_specification.rb:144:in `connection'
activerecord (3.2.8) lib/active_record/query_cache.rb:67:in `rescue in call'
activerecord (3.2.8) lib/active_record/query_cache.rb:61:in `call'
activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `_run__515326265__call__889079158__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.8) lib/rails/engine.rb:479:in `call'
railties (3.2.8) lib/rails/application.rb:223:in `call'
rack (1.4.5) lib/rack/content_length.rb:14:in `call'
railties (3.2.8) lib/rails/rack/log_tailer.rb:17: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:1484:in `event_callback'
eventmachine (1.0.3) lib/em/pure_ruby.rb:544:in `block in eventable_read'
eventmachine (1.0.3) lib/em/pure_ruby.rb:542:in `times'
eventmachine (1.0.3) lib/em/pure_ruby.rb:542:in `eventable_read'
/usr/lib/ruby/1.9.1/forwardable.rb:201:in `eventable_read'
eventmachine (1.0.3) lib/em/pure_ruby.rb:369:in `block in crank_selectables'
eventmachine (1.0.3) lib/em/pure_ruby.rb:369:in `each'
eventmachine (1.0.3) lib/em/pure_ruby.rb:369:in `crank_selectables'
eventmachine (1.0.3) lib/em/pure_ruby.rb:324:in `block in run'
eventmachine (1.0.3) lib/em/pure_ruby.rb:318:in `loop'
eventmachine (1.0.3) lib/em/pure_ruby.rb:318:in `run'
eventmachine (1.0.3) lib/em/pure_ruby.rb:62: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.4.5) lib/rack/handler/thin.rb:13:in `run'
rack (1.4.5) lib/rack/server.rb:268:in `start'
railties (3.2.8) lib/rails/commands/server.rb:70:in `start'
railties (3.2.8) lib/rails/commands.rb:55:in `block in <top (required)>'
railties (3.2.8) lib/rails/commands.rb:50:in `tap'
railties (3.2.8) lib/rails/commands.rb:50:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
I have not installed MySql Gem in my Gemfile
When I start the same application on another machine(My Senior's) it seems to work.The code seems to be same.I tried various sites for the solution but it does not seem to help..
Can someone please help me with this
I am using rails 3.2.12
Comment require 'rails/all' in /config/application.rb
and add these in the same file
require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"
also comment
#config.active_record.whitelist_attributes = true
Now in config/environments/development.rb
comment these lines
#config.active_record.mass_assignment_sanitizer = :strict
#config.active_record.auto_explain_threshold_in_seconds = 0.5
Check my commit on github when I got same error.
I am currently trying to install active admin on a rails mountable engine. The host application for the engine has authentication configured using devise. I have installed active admin without devise authentication using the --skip-user option [while running rake active_admin:install]. I am mounting the engine on the host application on the path /admin_app/.
When trying to access the URL:
http://localhost:3000/admin_app/admin
I am getting the following error
ActionController::RoutingError - uninitialized constant Admin::DashboardController:
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:57:in `rescue in controller'
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:52:in `controller'
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:32:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
railties (3.2.13) lib/rails/engine.rb:479:in `call'
railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
newrelic_rpm (3.6.9.171) lib/new_relic/rack/error_collector.rb:50:in `call'
newrelic_rpm (3.6.9.171) lib/new_relic/rack/error_collector.rb:50:in `call'
newrelic_rpm (3.6.9.171) lib/new_relic/rack/agent_hooks.rb:28:in `call'
newrelic_rpm (3.6.9.171) lib/new_relic/rack/browser_monitoring.rb:23:in `call'
newrelic_rpm (3.6.9.171) lib/new_relic/rack/developer_mode.rb:42: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'
actionpack (3.2.13) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.5) lib/rack/etag.rb:23:in `call'
rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in `call'
activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__342236532__call__311563165__callbacks'
activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
better_errors (1.0.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (1.0.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (1.0.1) lib/better_errors/middleware.rb:56:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call'
railties (3.2.13) lib/rails/engine.rb:479:in `call'
railties (3.2.13) lib/rails/application.rb:223:in `call'
rack (1.4.5) lib/rack/content_length.rb:14:in `call'
railties (3.2.13) lib/rails/rack/log_tailer.rb:17:in `call'
rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
/home/systemone/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/home/systemone/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/home/systemone/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
I just started getting this error when going to the Resque web ui on my server. It does not happen locally, and it did not happen before some recent app changes/upgrades I made. I made no changes to the server itself. I could start reverting back changelists to see where it broke, but I upgraded a lot of gems at once so I have a hunch it'll be quite tricky.
So, any idea what would cause this or where it might be originating?
The path I'm going to is mydomain.com/app/resque
routes.rb
scope :path => "/app" do
mount Resque::Server.new, :at => '/resque'
end
NoMethodError (undefined method `process_route' for #<Resque::Server:0x00000005dc95b0>):
newrelic_rpm (3.3.4.1) lib/new_relic/agent/instrumentation/sinatra.rb:38:in `block in dispatch_with_newrelic'
newrelic_rpm (3.3.4.1) lib/new_relic/agent/instrumentation/sinatra.rb:62:in `block in transaction_name'
newrelic_rpm (3.3.4.1) lib/new_relic/agent/instrumentation/sinatra.rb:61:in `each'
newrelic_rpm (3.3.4.1) lib/new_relic/agent/instrumentation/sinatra.rb:61:in `transaction_name'
newrelic_rpm (3.3.4.1) lib/new_relic/agent/instrumentation/sinatra.rb:37:in `dispatch_with_newrelic'
sinatra (1.0) lib/sinatra/base.rb:411:in `block in call!'
sinatra (1.0) lib/sinatra/base.rb:566:in `instance_eval'
sinatra (1.0) lib/sinatra/base.rb:566:in `block in invoke'
sinatra (1.0) lib/sinatra/base.rb:566:in `catch'
sinatra (1.0) lib/sinatra/base.rb:566:in `invoke'
sinatra (1.0) lib/sinatra/base.rb:411:in `call!'
sinatra (1.0) lib/sinatra/base.rb:399:in `call'
rack (1.4.1) lib/rack/auth/basic.rb:25:in `call'
sinatra (1.0) lib/sinatra/base.rb:979:in `block in call'
sinatra (1.0) lib/sinatra/base.rb:1005:in `synchronize'
sinatra (1.0) lib/sinatra/base.rb:979:in `call'
actionpack (3.2.1) lib/action_dispatch/routing/mapper.rb:40:in `call'
journey (1.0.3) lib/journey/router.rb:68:in `block in call'
journey (1.0.3) lib/journey/router.rb:56:in `each'
journey (1.0.3) lib/journey/router.rb:56:in `call'
actionpack (3.2.1) lib/action_dispatch/routing/route_set.rb:589:in `call'
omniauth (1.1.0) lib/omniauth/strategy.rb:177:in `call!'
omniauth (1.1.0) lib/omniauth/strategy.rb:157:in `call'
omniauth (1.1.0) lib/omniauth/builder.rb:48:in `call'
newrelic_rpm (3.3.4.1) lib/new_relic/rack/browser_monitoring.rb:23:in `call'
airbrake (3.0.9) lib/airbrake/rack.rb:27:in `call'
warden (1.1.1) lib/warden/manager.rb:35:in `block in call'
warden (1.1.1) lib/warden/manager.rb:34:in `catch'
warden (1.1.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.1) lib/rack/etag.rb:23:in `call'
rack (1.4.1) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/head.rb:14:in `call'
remotipart (1.0.2) lib/remotipart/middleware.rb:30:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/cookies.rb:338:in `call'
activerecord (3.2.1) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:443:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.1) lib/active_support/callbacks.rb:405:in `_run__2652675143263662148__call__736553824066291236__callbacks'
activesupport (3.2.1) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.1) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.1) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.1) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.1) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
rack-ssl (1.3.2) lib/rack/ssl.rb:27:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
airbrake (3.0.9) lib/airbrake/user_informer.rb:12:in `call'
railties (3.2.1) lib/rails/engine.rb:479:in `call'
railties (3.2.1) lib/rails/application.rb:220:in `call'
railties (3.2.1) lib/rails/railtie/configurable.rb:30:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/utils.rb:479:in `safe_fork'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:180:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/local/rvm/gems/ruby-1.9.3-p0#global/gems/passenger-3.0.11/helper-scripts/passenger-spawn-server:99:in `<main>'
You are combining a new version of new_relic with a very old version of sinatra. Run bundle update sinatra and make sure you have at least Sinatra 1.3.0, or try to downgrade the new_relic gem.
If you wonder why you have sinatra in your bundle at all: resque depends on it.
You could also add an explicite rule for a newer sinatra or an older new_relic to your Gemfile.
I resolved this by modifying my Gemfile to have the following lines:
gem 'sinatra', ">= 1.3.0"
gem 'newrelic_rpm'
gem 'resque'