Upgrade old rails app issues.. help


#1

Hi I never had to upgrade someone elses rail application so this is
getting a bit fustrating but mostly because I have no experience…
I downloaded http://sourceforge.net/projects/grabthemic that has not
been updated for 2 years but I am going to build a Digg alike site so
decided to not reinvent the wheel and pick up a current project…
but I get this error:

grabthemic-v0.7 $ ./script/server
=> Booting WEBrick
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:163:in
ensure_session_key': A key is required to write a cookie containing the session data. Use config.action_controller.session = { :key => "_myapp_session", :secret => "some secret phrase" } in config/environment.rb (ArgumentError) from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:74:ininitialize’
from
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/middleware_stack.rb:72:in
new' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/middleware_stack.rb:72:inbuild’
from
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/middleware_stack.rb:116:in
build' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/inflector.rb:361:ininject’
from
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/middleware_stack.rb:116:in
each' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/middleware_stack.rb:116:ininject’
from
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/middleware_stack.rb:116:in
build' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:82:ininitialize’
from
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:52:in
new' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:52:inrun_prepare_callbacks’
from
/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:609:in
prepare_dispatcher' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:183:inprocess’
from
/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in send' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:inrun’
from /home/rek2/Desktop/grabthemic-v0.7/config/environment.rb:10
from
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in
require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:innew_constants_in’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in
require' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/server.rb:84 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
from
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
from ./script/server:3


#2

Use config.action_controller.session = { :key =>
“_myapp_session”, :secret => “some secret phrase” } in
config/environment.rb

so open config/environment.rb and make changes as required.

tom

<---|Rek2|--–> wrote:

/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:163:in
from
each' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:52:in /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:insend’
require'gem_original_require’
from
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
from ./script/server:3

Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz


#3

Hi, any help with this?


#4

On 7 May 2009, at 11:18, “<---|Rek2|--–>”
removed_email_address@domain.invalid wrote:

Hi, any help with this?

Have you tried doing what the error message suggests?

Fred


#5

I’m having this same problem…

Dead simple application created in 1.2.6. No database, no sessions,
pretty much a site which could have just been static HTML, but was
planned to extend beyond that (and now is).

What’s confusing to me about the suggestion made by the error message
(to add config.action_controller.session into environment.rb) is that it
looks identical in purpose to the code in
/initializers/session_store.rb.

Either way, adding the code to environment.rb, and making sure the key
was the same in session_store.rb, did not fix the problem. mongrel log
still reports the same error, and the app still won’t start up.

BTW – I have upgraded another 1.2.6 app, but that one used db session
store, and it worked immediately after my update process.

– gw