Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

This project is archived and is in readonly mode.

edge rails sends include to uninitialized constant Rack::Session::Abstract::SessionHash

#5778

Not sure if this is a bug in rack or rails but attempts to use the rails cmd after creating a new app on edge rails emits the following backtrace:

test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:23: uninitialized constant     Rack::Session::Abstract::SessionHash (NameError)
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb:3
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/application/configuration.rb:126:in `const_get'
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/application/configuration.rb:126:in `session_store'
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/application.rb:159:in `default_middleware_stack'
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/application.rb:143:in `tap'
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/application.rb:143:in `default_middleware_stack'
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/engine.rb:402:in `build_middleware_stack'
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/application/finisher.rb:37
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/initializable.rb:25:in `instance_exec'
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/initializable.rb:25:in `run'
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/initializable.rb:50:in `run_initializers'
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/initializable.rb:49:in `each'
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/initializable.rb:49:in `run_initializers'
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/application.rb:94:in `initialize!'
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/railtie/configurable.rb:30:in `send'
from test-app/ruby/1.8/bundler/gems/rails-f659a1576fc4/railties/lib/rails/railtie/configurable.rb:30:in `method_missing'
from test-app/config/environment.rb:5
from test-app/config.ru:3:in `require'
from test-app/config.ru:3
from test-app/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from test-app/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from test-app/config.ru:1:in `new'
from test-app/config.ru:1

On ruby 1.8.7-p302

Steps to reproduce:


rails new test-app --edge -T -J
cd test-app
bundle install
rails generate

Will continue investigating but wanted to put this out there in case it's an easy fix for those more familiar w/ rails internals.

Reported by Jeremiah · October 10th, 2010 @ 11:28 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Andrea Campi
    Andrea Campi

    AFAIK you need to use edge rack:

    gem 'rack', :git => 'git://github.com/rack/rack.git'
    

    October 10th, 2010 @ 11:35 PM

  2. Jeremiah
    Jeremiah

    That works, thanks.

    Should that line be included in the Gemfile template for new edge rails apps or does that cause other issues?

    October 11th, 2010 @ 01:52 PM

  3. Andrea Campi
    Andrea Campi

    Actually, you should have that line in your Gemfile, as long as you have a (recent) edge installed.
    It's not enough to use the rails script from an edge checkout, you need to install edge gems.

    October 11th, 2010 @ 02:05 PM

  4. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to resolved
    • Importance changed from to Low

    October 11th, 2010 @ 02:24 PM

  5. Jeremiah
    Jeremiah

    I might be missing something but if edge rails always uses edge gems then does it make sense that it declare those in the Gemfile template (like it does for arel).

    I didn't use the rails script from edge but from the installed gem @ 3.0.0. Is this not the correct usage? If not I see a spot in the guides that could be updated for clarity.

    eg. in railties/lib/rails/generators/rails/app/templates/Gemfile

    <%- if options.dev? -%>
    gem 'rails', :path => '<%= Rails::Generators::RAILS_DEV_PATH %>'
    gem 'arel',  :git => 'git://github.com/rails/arel.git'
    <%- elsif options.edge? -%>
    gem 'rails', :git => 'git://github.com/rails/rails.git'
    gem 'arel',  :git => 'git://github.com/rails/arel.git'
    gem 'rack', :git => 'git://github.com/rack/rack.git'             # < = like so?
    <%- else -%>
    gem 'rails', '<%= Rails::VERSION::STRING %>'
    
    # Bundle edge Rails instead:
    # gem 'rails', :git => 'git://github.com/rails/rails.git'
    <%- end -%>
    

    October 11th, 2010 @ 02:49 PM

  6. Santiago Pastorino
  7. Thomas van der Pol
    Thomas van der Pol

    I was testing a patch and used my local git repository as a dependency in a freshly generated app ( gem 'rails', :path => 'path/to/src' ) and ran into this same problem. Note the slightly different use case from the original ticket - I did not want my normal app to rely on edge rails but instead wanted to use a local repository of code as my rails gem to test a patch.

    Josh K in IRC recommended I instead fork the rails repo and use the remote git repository of my fork as the gem dependency. This has the same issue also.

    Manually adding the dependencies on edge rack and edge arel solved this problem, as described above.

    I would be happy to add a bit of documentation to the contrib guide (http://guides.rubyonrails.org/contributing_to_ruby_on_rails.html) explaining how to set up a rails app to use either a local code directory or a private fork for the purposes of testing patches or your own development (such a section is currently missing). Before I dive into that, I just want to verify this would be the correct thing to do.

    February 17th, 2011 @ 02:31 PM

  8. Josh Kalderimis
    Josh Kalderimis

    Hey Thomas,

    I have checked with Santiago and it would be great if you could add some further documentation about this in the docrails repository. (https://github.com/lifo/docrails)

    Thanks for taking the time to look into this,

    Josh

    February 17th, 2011 @ 05:10 PM