Why am I getting this Cache-money error? - ruby-on-rails

I followed the instructions found on the github page exactly. I would post some of my configuration but it matches what's found here on http://github.com/nkallen/cache-money/tree/master
The error reads as follows:
/!\ FAILSAFE /!\ Thu Mar 05 16:45:09 -0500 2009
Status: 500 Internal Server Error
undefined method `indices' for nil:NilClass
(__DELEGATION__):2:in `__send__'
(__DELEGATION__):2:in `indices'
(__DELEGATION__):2:in `__send__'
(__DELEGATION__):2:in `indices'
/usr/lib/ruby/gems/1.8/gems/nkallen-cache-money-0.2.5/lib/cash/query/abstract.rb:114:in `indexed_on?'
/usr/lib/ruby/gems/1.8/gems/nkallen-cache-money-0.2.5/lib/cash/query/abstract.rb:56:in `cacheable?'
/usr/lib/ruby/gems/1.8/gems/nkallen-cache-money-0.2.5/lib/cash/query/abstract.rb:15:in `perform'
/usr/lib/ruby/gems/1.8/gems/nkallen-cache-money-0.2.5/lib/cash/query/abstract.rb:7:in `perform'
/usr/lib/ruby/gems/1.8/gems/nkallen-cache-money-0.2.5/lib/cash/finders.rb:24:in `find_every'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1452:in `find_initial'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:587:in `find'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session/active_record_store.rb:113:in `find_by_session_id'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session/active_record_store.rb:79:in `find_by_session_id'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session/active_record_store.rb:288:in `initialize'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1398:in `silence'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session/active_record_store.rb:288:in `initialize'
/usr/lib/ruby/1.8/cgi/session.rb:279:in `new'
/usr/lib/ruby/1.8/cgi/session.rb:279:in `initialize_without_cgi_reader'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/cgi_ext/session.rb:19:in `initialize'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/cgi_process.rb:94:in `new'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/cgi_process.rb:94:in `session'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/cgi_process.rb:130:in `stale_session_check!'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/cgi_process.rb:78:in `session'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:1205:in `assign_shortcuts_without_flash'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/flash.rb:166:in `assign_shortcuts'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:519:in `process_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in `process_without_session_management_support'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session_management.rb:134:in `process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:392:in `process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:183:in `handle_request'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:110:in `dispatch_unlocked'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:123:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:132:in `dispatch_cgi'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:39:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in `process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:282:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in `load_without_new_constant_marking'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in `load'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in `load'
/usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/servers/mongrel.rb:64
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/server.rb:49
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
script/server:3
Any ideas? Thanks.

the cache-money initializer in config/initializers/cache_money.rb seems to need the session_store as mem_cache_store
for me it works like this:
config/environment.rb:
config.action_controller.session_store = :mem_cache_store
config/environments/production.rb:
config.after_initialize do
ActionController::Base.session_store = :active_record_store
end

The problem was caused by using ActiveRecord as my session store.
Using the given initializer on the cache money github attempts to use cache money for ActiveRecord::SessionStore (rails 2.3) which isn't a complete ActiveRecord (I assume for performance reasons).

I had a similar issue after updating to Rails 2.3.
I still had the line
config.action_controller.session_store = :active_record_store
in my environment.rb
I got it fixed by replacing it with
ActionController::Base.session_store = :active_record_store
in an initializer file.

Related

ActiveRecord::StatementInvalid even when I add table in rails 2.3.18

I am working on maintenance project which has rails version '2.3.18' and rvm use ree-1.8.7-2012.02 [ x86_64 ].
When i am runnin rake db:migrate after bundle install and rake db:create, i am getting the following error as:
rake aborted!
Could not find table 'comments'
(See full trace by running task with --trace)
For this I am manually creating comments table as:
ruby script/generate migration CreateComments commentable_type:string commentable_id:integer body:text member_id:integer created_at:datettime
For this I am getting the error as:
/root/Desktop/Projects/community/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `table_structure': Could not find table 'comments' (ActiveRecord::StatementInvalid)
from /root/Desktop/Projects/community/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `tap'
from /root/Desktop/Projects/community/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'
from /root/Desktop/Projects/community/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:228:in `columns'
from /root/Desktop/Projects/community/lib/extensions/active_record.rb:8:in `columns'
from /root/Desktop/Projects/community/vendor/rails/activerecord/lib/active_record/base.rb:1318:in `column_names'
from /root/Desktop/Projects/community/vendor/gems/acts-as-taggable-on-2.0.4/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb:5:in `included'
from /root/Desktop/Projects/community/vendor/gems/acts-as-taggable-on-2.0.4/lib/acts_as_taggable_on/acts_as_taggable_on/collection.rb:28:in `any?'
from /root/Desktop/Projects/community/vendor/gems/acts-as-taggable-on-2.0.4/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb:5:in `each'
from /root/Desktop/Projects/community/vendor/gems/acts-as-taggable-on-2.0.4/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb:5:in `any?'
from /root/Desktop/Projects/community/vendor/gems/acts-as-taggable-on-2.0.4/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb:5:in `included'
from /root/Desktop/Projects/community/vendor/gems/acts-as-taggable-on-2.0.4/lib/acts_as_taggable_on/acts_as_taggable_on.rb:46:in `include'
from /root/Desktop/Projects/community/vendor/gems/acts-as-taggable-on-2.0.4/lib/acts_as_taggable_on/acts_as_taggable_on.rb:46:in `acts_as_taggable_on'
from /root/Desktop/Projects/community/vendor/gems/acts-as-taggable-on-2.0.4/lib/acts_as_taggable_on/acts_as_taggable_on.rb:36:in `class_eval'
from /root/Desktop/Projects/community/vendor/gems/acts-as-taggable-on-2.0.4/lib/acts_as_taggable_on/acts_as_taggable_on.rb:36:in `acts_as_taggable_on'
from /root/Desktop/Projects/community/vendor/gems/acts-as-taggable-on-2.0.4/lib/acts_as_taggable_on/acts_as_taggable_on.rb:15:in `acts_as_taggable'
from /root/Desktop/Projects/community/app/models/comment.rb:58
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/dependencies.rb:406:in `load_without_new_constant_marking'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/dependencies.rb:406:in `load_file'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/dependencies.rb:405:in `load_file'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/dependencies.rb:285:in `require_or_load'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/dependencies.rb:451:in `load_missing_constant'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/dependencies.rb:106:in `const_missing'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/dependencies.rb:118:in `const_missing'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/inflector.rb:364:in `constantize'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/inflector.rb:363:in `each'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/inflector.rb:363:in `constantize'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'
from /root/Desktop/Projects/community/vendor/rails/activerecord/lib/active_record/observer.rb:157:in `observed_class'
from /root/Desktop/Projects/community/vendor/rails/activerecord/lib/active_record/observer.rb:183:in `observed_classes'
from /root/Desktop/Projects/community/vendor/rails/activerecord/lib/active_record/observer.rb:166:in `initialize'
from /usr/local/rvm/rubies/ree-1.8.7-2012.02/lib/ruby/1.8/singleton.rb:94:in `new'
from /usr/local/rvm/rubies/ree-1.8.7-2012.02/lib/ruby/1.8/singleton.rb:94:in `instance'
from /root/Desktop/Projects/community/vendor/rails/activerecord/lib/active_record/observer.rb:38:in `instantiate_observers'
from /root/Desktop/Projects/community/vendor/rails/activerecord/lib/active_record/observer.rb:36:in `each'
from /root/Desktop/Projects/community/vendor/rails/activerecord/lib/active_record/observer.rb:36:in `instantiate_observers'
from /root/Desktop/Projects/community/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:15:in `define_dispatcher_callbacks'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/callbacks.rb:182:in `call'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/callbacks.rb:182:in `evaluate_method'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in `call'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `run'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `each'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `send'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in `run'
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in `run_callbacks'
from /root/Desktop/Projects/community/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:51:in `send'
from /root/Desktop/Projects/community/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:51:in `run_prepare_callbacks'
from /root/Desktop/Projects/community/vendor/rails/railties/lib/initializer.rb:631:in `prepare_dispatcher'
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:185:in `process'
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
from /root/Desktop/Projects/community/config/environment.rb:15
from /usr/local/rvm/rubies/ree-1.8.7-2012.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/local/rvm/rubies/ree-1.8.7-2012.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from /root/Desktop/Projects/community/vendor/rails/railties/lib/commands/generate.rb:1
from /usr/local/rvm/rubies/ree-1.8.7-2012.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/local/rvm/rubies/ree-1.8.7-2012.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from script/generate:3
Please help me out.
Could you show us your model Comment? It might have something to do with it, as you can see in the stack trace:
from /root/Desktop/Projects/community/vendor/gems/acts-as-taggable-on-2.0.4/lib/acts_as_taggable_on/acts_as_taggable_on.rb:15:in `acts_as_taggable'
from /root/Desktop/Projects/community/app/models/comment.rb:58
from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/dependencies.rb:406:in `load_without_new_constant_marking'
created_at:datettime is misspelled.. it's created_at:datetime

Error running ruby server

I am trying to run ruby server in ubuntu 12.04,rails 2.3.11,ruby 1.8.3 gem 1.5.3 and get this. Is this a dependencies issue.or configuration issue.Please help me. Thanks in advance.
root#virinchy-Aspire-4535:~/BBYIDX-2/BBYIDX-master# script/server
=> Booting WEBrick
=> Rails 2.3.18 application starting on http:/0.0.0.0:3000
Faraday: you may want to install system_timer for reliable timeouts
/usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:941:in `initialize':
Is there something i need to fix here
FATAL: role "bbyidx" does not exist (PGError)
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:941:in `connect'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:941:in `connect'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:217:in `initialize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `new'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout'
from /usr/local/rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/monitor.rb:242:in `synchronize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/base.rb:1299:in `table_exists?'
from /home/virinchy/BBYIDX-2/BBYIDX-master/app/models/user.rb:73
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:406:in `load_without_new_constant_marking'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:406:in `load_file'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:405:in `load_file'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:285:in `require_or_load'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:451:in `load_missing_constant'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:106:in `const_missing'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:118:in `const_missing'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/inflector.rb:364:in `constantize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/inflector.rb:363:in `each'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/inflector.rb:363:in `constantize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:157:in `observed_class'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:183:in `observed_classes'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:166:in `initialize'
from /usr/local/rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/singleton.rb:94:in `new'
from /usr/local/rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/singleton.rb:94:in `instance'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:38:in `instantiate_observers'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:36:in `each'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activerecord-2.3.18/lib/active_record/observer.rb:36:in `instantiate_observers'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:15:in `define_dispatcher_callbacks'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:182:in `call'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:182:in `evaluate_method'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:166:in `call'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:90:in `run'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:90:in `each'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:90:in `send'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:90:in `run'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/callbacks.rb:276:in `run_callbacks'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:51:in `send'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:51:in `run_prepare_callbacks'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/initializer.rb:631:in `prepare_dispatcher'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/initializer.rb:185:in `process'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/initializer.rb:113:in `send'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/initializer.rb:113:in `run'
from /home/virinchy/BBYIDX-2/BBYIDX-master/config/environment.rb:22
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.18/lib/commands/server.rb:84
from script/server:3:in `require'
from script/server:3
This is your issue:
FATAL: role "bbyidx" does not exist (PGError)
You're attempting to connect to your PostgreSQL database using a role that doesn't exist. You can create this role by using the createuser command in your terminal.
createuser bbyidx

Error calling Dispatcher.dispatch #<NameError: uninitialized constant ActionController::CgiRequest

I'm getting the following error on log/mongrel.6001.log
I'm using mongrel_cluster , rails 3 and ruby 1.8.7
I start mongrel_cluster using mongrel_rails cluster::start
But when I try to access the page on browser I get the error bellow
"Error calling Dispatcher.dispatch #
Mon Oct 11 00:26:04 -0500 2010: Error calling Dispatcher.dispatch #<NameError: uninitialized constant ActionController::CgiRequest>
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in `process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:159:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:282:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/usr/bin/mongrel_rails:19:in `load'
/usr/bin/mongrel_rails:19
Can anyone help?
mongrel_cluster.yml
---
address: 127.0.0.1
log_file: log/mongrel.log
port: "6001"
cwd: /home/maiordes/rails_apps/maiordesconto
environment: development
pid_file: tmp/pids/mongrel.pid
servers: 5
As far as I know, mongrel_cluster does not support Rails 3 yet. Fastest solution is to switch to Thin, it supports multiple Rails instances and it's configuration file is very similar to Mongrel's one.

Having a weird bug with mongrel

This is from the development log...
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:101:in `dispatch_cgi'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:27:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in `process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:159:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:282:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/usr/bin/mongrel_rails:19:in `load'
/usr/bin/mongrel_rails:19
/!\ FAILSAFE /!\ Thu Apr 15 20:19:18 +0000 2010
Status: 500 Internal Server Error
This i guess is a simple case of there not being a database configured. Create a database first using: rake db:create:all
What is the params hash that is sent from the form (or the form input names) ? The issue might be related of Rails's inability to parse a mixed array-hash values. PS I don't find the question obnoxious, aside the huge paste (arguable somewhat necessary)
Me sure you don't send in the request a mixed array hash value as rails will complain, ie.:
user[][name] => joe # array-ish
user[:key][name] => alice # hash-ish
both in the same request.

ActionController::MethodNotAllowed after reloading routes?

I have an application where I'm dynamically loading routes by a model, and calling ActionController::Routing::Routes.reload! after creating/updating that model. The problem is that after doing this, I'm receiving the following error when I try to hit that new route:
ActionController::MethodNotAllowed
Only get, head, post, put, and delete requests are allowed.
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/routing/recognition_optimisation.rb:65:in `recognize_path'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/routing/route_set.rb:384:in `recognize'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:148:in `handle_request'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:107:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:104:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/dispatcher.rb:35:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:76:in `process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in `process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:282:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:502:in `load'
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/mongrel.rb:64
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
script/server:3
What's really odd is that the request has no parameters, and the response headers are {"cookie"=>[],
"Allow"=>"GET,
HEAD,
POST,
PUT,
DELETE",
"Cache-Control"=>"no-cache"}
All this even though the request is definitely GET (according to Firebug) and according to the response GET is certainly allowed.
I'm using Rails 2.1.0 and Mongrel 1.1.5 (after googling, I noticed some have problems with older versions).
Anyone have thoughts?
Apparently this was a bug in Rails 2.1.0. Upgrading to Rails 2.2.1 fixed the problem.
Upgrading to 2.1.2 also fixes this in case you don't want to potentially break your site with 2.2.

Resources