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.

This project is archived and is in readonly mode.

Unable to run working edge app with vendored rails.

#2567

$ mkdir -p edge/vendor/rails
$ cd edge
$ git clone git://github.com/rails/rails.git ./vendor/rails
$ ruby vendor/rails/railties/bin/rails .

Everything is fine so far.


$ rake -T --trace
rake aborted!
undefined method `mattr_accessor' for ActiveSupport::Dependencies:Module
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:6
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Users/andriytyurnikov/Job/edge3/config/../vendor/rails/railties/lib/rails/plugin.rb:3
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Users/andriytyurnikov/Job/edge3/config/../vendor/rails/railties/lib/rails/plugin/loader.rb:1
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Users/andriytyurnikov/Job/edge3/config/../vendor/rails/railties/lib/initializer.rb:9
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Users/andriytyurnikov/Job/edge3/config/boot.rb:45:in `load_initializer'
/Users/andriytyurnikov/Job/edge3/config/boot.rb:38:in `run'
/Users/andriytyurnikov/Job/edge3/config/boot.rb:11:in `boot!'
/Users/andriytyurnikov/Job/edge3/config/boot.rb:110
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Users/andriytyurnikov/Job/edge3/Rakefile:4

And if I try to start server:

@@@shell $ script/server ./script/../config/../vendor/rails/railties/lib/rails/plugin.rb:1:in require': no such file to load -- active_support/core_ext/kernel/reporting (LoadError)

from ./script/../config/../vendor/rails/railties/lib/rails/plugin.rb:1
from ./script/../config/../vendor/rails/railties/lib/rails/plugin/loader.rb:1:in `require'
from ./script/../config/../vendor/rails/railties/lib/rails/plugin/loader.rb:1
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:9:in `require'
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:9
from ./script/../config/boot.rb:45:in `require'
from ./script/../config/boot.rb:45:in `load_initializer'
from ./script/../config/boot.rb:38:in `run'
from ./script/../config/boot.rb:11:in `boot!'
from ./script/../config/boot.rb:110
from script/server:2:in `require'
from script/server:2



Is it me, or initializer?

Reported by Andriy Tyurnikov · April 26th, 2009 @ 11:56 PM

State: resolved
Milestone: 2.x
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. John Small
    John Small

    No it's not you, I can't generate a working edge rails app either.

    April 28th, 2009 @ 07:00 AM

  2. Mischa
    Mischa
    • Title changed from Unable to generate working edge app. to Unable to run working edge app with vendored rails.

    +1

    Changing title, as the following worksforme.

    
    $ git clone git://github.com/rails/rails.git 
    $ ruby rails/railties/bin/rails new_project
    $ cd new_project
    $ script/server
    

    However, it doesn't work, and I get the same errors as Andriy, as soon as I add rails into vendor.

    I played with it for a bit, to try to get it to work. It seems like ActiveSupport is just not loaded when /vendor/rails/railties/lib/rails/plugin.rb:1 is run.

    E.g. requiring rubygems and active_support move the error to another file. Requiring that file moves it to another file.

    April 28th, 2009 @ 07:07 AM

  3. Vidal Graupera
    Vidal Graupera

    @ Andriy Tyurnikov

    Try instead from your rails directory

    cd vendor git clone git://github.com/rails/rails.git cd rails git checkout -b 2-3-stable origin/2-3-stable

    April 28th, 2009 @ 09:13 AM

  4. Andriy Tyurnikov
    Andriy Tyurnikov

    @ Vidal Graupera ... and I will get stable 2-3 version of rails, right? I can get it without touching repo - from my gem. =)

    With git clone git://github.com/rails/rails.git cd rails git checkout -b 2-3-stable origin/2-3-stable I'll be able to contribute to 2.3-stable bugfix? And the fact that edge is not usable for apps is ok - is that your point?

    Perhaps contributor guide needs new section about usage of edge, and role of repo tags - I am not getting the idea :(

    April 28th, 2009 @ 09:26 AM

  5. John Small
    John Small

    OK, going back to 2-3-stable fixes the problem so now it's a question of binary searching to see which commit after 2-3-stable introduced the problem.

    April 28th, 2009 @ 09:27 AM

  6. John Small
    John Small

    Found it!

    Commit ab321268f86d9013cbd4ecd0b5f46e7b05ec55a9 "No more free lunch"

    After that commit you can't load Rails, before it you can. The commit relates to core_ext/kernel/requires.rb which is the thing missing.

    I'll email Jeremy Kemper, it's one of his commits.

    April 28th, 2009 @ 09:59 AM

  7. John Small
    John Small
    • Assigned user set to Jeremy Kemper

    April 28th, 2009 @ 10:01 AM

  8. Taryn East
    Taryn East

    Just a +1. I've had the same issue from edge in vendor/rails.

    April 28th, 2009 @ 10:11 AM

  9. John Small
    John Small
    • Tag set to active_support core_ext

    So now we know which commit introduced the change we need to write a test to make sure that Rails can load. I was using script/console to test each version while binary searching. There must be a test already in the test suite to make sure that Rails console can load, clearly it didn't pick up this issue for some reason.

    April 28th, 2009 @ 10:16 AM

  10. Jeremy Kemper
    Jeremy Kemper

    Looking at your backtrace, you're getting a mix of vendor/rails and the non-edge activesupport gem.

    April 28th, 2009 @ 04:13 PM

  11. Mischa
    Mischa

    Jeremy, Thanks - I think you may have found the problem. I will look at tonight and post if I can find solution.

    April 28th, 2009 @ 04:15 PM

  12. John Small
    John Small

    Jeremy. This seems to be an odd mix of problems.

    The rake -T --trace problem where it goes hunting in the gem version of active support rather than in vendor/rails is introduced in commit 7f6779c1d5e4ec7f642839caa7e86320720f77c8 "merge branch master into 'cherry'"

    The seemingly similar problem with script/console or script/server comes in with commit ab321268f86d9013cbd4ecd0b5f46e7b05ec55a9 "No more free lunch"

    That one doesn't involve the system looking for files in gem rails, it seems to be all within vendor/rails as in the traces in the message at the start of this thread.

    April 28th, 2009 @ 06:05 PM

  13. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to resolved

    I made some updates to the boot process. Generating an app, using the console, and running the server work for me. Thanks for the report!

    April 29th, 2009 @ 02:31 AM

  14. John Small
    John Small

    Brilliant, it works now!

    April 29th, 2009 @ 09:09 AM

  15. sidcarter
    sidcarter

    Still have a problem doing this on Debian Linux 5.0 -

    This is with the latest edge, rubygems 1.3.3 and ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]

    champloo:~/Sandbox/edge_rails$ script/server
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- active_support/core_ext/kernel/reporting (LoadError)

        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from ./script/../config/../vendor/rails/railties/lib/rails/plugin.rb:1
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from ./script/../config/../vendor/rails/railties/lib/rails/plugin/loader.rb:1
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from ./script/../config/../vendor/rails/railties/lib/initializer.rb:1069:in `default_plugin_loader'
        from ./script/../config/../vendor/rails/railties/lib/initializer.rb:856:in `initialize'
        from ./script/../config/../vendor/rails/railties/lib/initializer.rb:107:in `new'
        from ./script/../config/../vendor/rails/railties/lib/initializer.rb:107:in `run'
        from ./script/../config/boot.rb:46:in `load_initializer'
        from ./script/../config/boot.rb:38:in `run'
        from ./script/../config/boot.rb:11:in `boot!'
        from ./script/../config/boot.rb:110
        from script/server:2:in `require'
        from script/server:2
    

    Something that I am doing wrong ?

    May 19th, 2009 @ 05:02 AM

  16. Jeremy Kemper
    Jeremy Kemper

    Interesting, works for me on 1.8.7, but reproducible with 1.8.6. I'll fix.

    May 19th, 2009 @ 07:17 PM

  17. Jeremy Kemper
    Jeremy Kemper

    The problem was that AS isn't yet added to the load path when this file is required. Fixed by lazy-requiring the extension.

    May 19th, 2009 @ 08:24 PM

  18. sidcarter
  19. fdgpdsjfgj
    fdgpdsjfgj
    • Importance changed from to

    I resolved this by setting the variable RUBYLIB as defined in here:
    http://www.tutorialspoint.com/ruby/ruby_environment_variables.htm

    I typed into my terminal:

    export RUBYLIB=/usr/lib/ruby/1.8/:/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib:/usr/lib/ruby/1.8/i486-linux/
    
    Probably your path is different.
    To find the right path, wo can write
    
    
    

    updatedb

    
    
    

    locate active_support/core_ext/kernel/reporting.rb

    
    
    
    And add to RUBYLIB what comes before "active_support".
    (updatedb is only needed the first time)

    Best regards.

    January 2nd, 2011 @ 02:37 PM

  20. fdgpdsjfgj
    fdgpdsjfgj

    I resolved this by setting the variable RUBYLIB as defined in here:
    http://www.tutorialspoint.com/ruby/ruby_environment_variables.htm

    I typed into my terminal:

    export RUBYLIB=/usr/lib/ruby/1.8/:/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib:/usr/lib/ruby/1.8/i486-linux/
    
    Probably your path is different.
    To find the right path, wo can write
    # updatedb

    locate active_support/core_ext/kernel/reporting.rb

    
    
    
    And add to RUBYLIB what comes before "active_support".
    (updatedb is only needed the first time)

    Best regards.

    January 2nd, 2011 @ 02:39 PM

  21. fdgpdsjfgj
    fdgpdsjfgj

    Isn't there a preview function here? I did it exactly as described in "Formatting help" but it didn't work :(

    January 2nd, 2011 @ 02:40 PM

  22. bingbing