I’m working on my first Rails (2.3.5) app and I’m experimenting with
activating the Active Record Store after running into the 4K limit of
the Cookie Store (I don’t really know how I ended up filling the cookie
store, I didn’t put that much in there!).
I didn’t do much:
rake db:sessions:create
rake db:migrate
=> Sessions table got created
added “config.action_controller.session_store = :active_record_store”
to environment.rb
And now I can’t even start Mongrel!
“2540”
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://127.0.0.1:3000
F:/Programming/Ruby/Ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:98:in
`insert_after’: You have a nil object when you didn’t expect it!
(NoMethodError)
You might have expected an instance of Array.
The error occurred while evaluating nil.+
Also, if I try to run a rake task, such as a db:migrate, I get a similar
error:
rake db:migrate
(in F:/Programming/Ruby/Workspace/shareyourstyle)
rake aborted!
You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.+
If I disable the line in environment.rb, everything is back to normal…
Any idea what is going on? Those errors message are really not doing
much for me
“2540”
=> Booting Mongrel
=> Rails 2.3.5 application starting onhttp://127.0.0.1:3000
F:/Programming/Ruby/Ruby186/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/act ion_controller/middleware_stack.rb:98:in
`insert_after’: You have a nil object when you didn’t expect it!
(NoMethodError)
You might have expected an instance of Array.
The error occurred while evaluating nil.+
Are you doing any other fiddling with the middleware stack ?
Are you doing any other fiddling with the middleware stack ?
Fred
Fred,
I personally don’t
Now, one of the plugin I use may… I removed the active_store line from
environment.rb (otherwise I can’t run anything) and ran “rake
middleware”:
rake middleware
(in F:/Programming/Ruby/Workspace/shareyourstyle)
use Rack::Lock
use ActionController::Failsafe
use ActionController::Session::CookieStore, #Proc:0x04d38098@:8(eval)
use Rack::Facebook, “523d1154a982433afddb3f5f77c0d17c”
use ActionController::ParamsParser
use Rack::MethodOverride
use Rack::Head
use ActionController::StringCoercion
use ActiveRecord::ConnectionAdapters::ConnectionManagement
use ActiveRecord::QueryCache
run ActionController::Dispatcher.new
I can see Facebook (Facebooker plugin) here, and CookieStore … The
rest is the default, I guess?
I made it work by going into initializers / session_store.rb and
activating the :active_record_store from there, using the line that was
already there and commented (duh) :