Rack::Session:Cookie error using Sinatra, Thin, Rails, and Rack::Cascade -


I have a combined Sinatra / Rail app that shares a session using rack :: Session :: Cookie. The app works fine when it starts with Rack :: Handler :: Thin. Run app , but if the racket file starts with thin start , then one in the rack Get the error:: Session :: Cookie:

  !! Unexpected error while processing the request: No marshal_dump is defined for the class Proc no marshal_dump is defined for the class /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.0. 1 / lib / rack / session / cookie .rb: 64: `dump '/usr/local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/session/cookie.rb: 64: in 'commit_session' / usr /local/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/session/cookie.rb:38:in 'call' / usr / local /lib/ruby/gems/1.9. 1 / gemstone / thin -1.2.5 / leeb / thin / connection RB: 76: 'block in pre_process' /usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.5/lib/thin/connection.rb:74:IN 'hold' / usr / local /lib/ruby/gems/1.9.1/gems/thin-1.2.5/lib/thin/connection.rb:74:in 'Pre_process' /usr/local/lib/ruby/gems/1.9.1/gems/ Thin-1.2.5 / lib / thin / connection.rb: 57: in 'process' /usr/local/lib/ruby/gems/1.9. 1 / gemstone / thin -1.2.5 / leeb / thin / connection RB: 42: `Prapt_deta '/ / url .rb in /local/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine: 256:` Rn_macin' / usr / local / lib / Ruby / gems / 1.9.1 / gems / eventmac in Hine-0.12.10 / lib / eventmachine.rb: 256: `run '/usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2. In 5 / lib / thin / backends / base.rb: 57: `Start '/ URL / Local / Lib / Ruby / Games / 1.9.1 / Games / Thin-1.2.5 / Lib / Thin / Accenture RBI 156: In 'Start' / USR / Local / Lib / usr / gems/1.9.1/gems/thin-1.2.5/lib/thin/controllers/controller.rb:80:IN 'Start' / usr / Local / lib / ruby ​​/ gems / 1.9.1 / g / thin -1.2.5 / leeb / thin / runner RB: 177: `Run_common '/ / url /local/lib/ruby/gems/1.9.1/gems/thin-1.2.5/lib/thin/runner.rb In: 143:` Run! '/usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.5/bin/thin:6:in' ' 

The racket file looks like this :

  Required :: File :: DIRNAM (__ file__) + '/ config / environment' requires 'thin' app = rack :: builder.nu {Rail Pulse :: rack :: static runs rack :: Cascade.new ([Sinatra :: application, action Controlr :: dispatcher. Anve])} Use .to_app rack :: session :: Cookie ,: key => '_example' ,: Domain => 'example.org',: secret => 'secret' # this rack :: handler :: thin.run app, port => 4000, hoos T => "0.0.0.0" #: Use the run app  

Have you tried to do something like this:

  app = rack :: Builder.new {use rack :: session :: cookie,: key = & gt; '_example' ,: domain = & gt; 'Example.org' ,: secret = & gt; Use the 'Secret' Rail :: Rack :: Static Run Rack :: Cascade.N.U. ([Sinatra :: App, Action Controller :: Dispatcher. NY]} .to_app  

It seems that your problem is that you are using the app outside the rack :: session :: cookie.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -