This project is archived and is in readonly mode.

#2567 ✓resolved
Andriy Tyurnikov

Unable to run working edge app with vendored rails.

Reported by Andriy Tyurnikov | April 26th, 2009 @ 11:56 PM | in 2.x


$ 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?

Comments and changes to this ticket

  • John Small

    John Small April 28th, 2009 @ 07:00 AM

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

  • Mischa

    Mischa April 28th, 2009 @ 07:07 AM

    • 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.

  • Vidal Graupera

    Vidal Graupera April 28th, 2009 @ 09:13 AM

    @ 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

  • Andriy Tyurnikov

    Andriy Tyurnikov April 28th, 2009 @ 09:26 AM

    @ 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 :(

  • John Small

    John Small April 28th, 2009 @ 09:27 AM

    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.

  • John Small

    John Small April 28th, 2009 @ 09:59 AM

    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.

  • John Small

    John Small April 28th, 2009 @ 10:01 AM

    • Assigned user set to “Jeremy Kemper”
  • Taryn East

    Taryn East April 28th, 2009 @ 10:11 AM

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

  • John Small

    John Small April 28th, 2009 @ 10:16 AM

    • 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.

  • Jeremy Kemper

    Jeremy Kemper April 28th, 2009 @ 04:13 PM

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

  • Mischa

    Mischa April 28th, 2009 @ 04:15 PM

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

  • John Small

    John Small April 28th, 2009 @ 06:05 PM

    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.

  • Jeremy Kemper

    Jeremy Kemper April 29th, 2009 @ 02:31 AM

    • 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!

  • John Small

    John Small April 29th, 2009 @ 09:09 AM

    Brilliant, it works now!

  • sidcarter

    sidcarter May 19th, 2009 @ 05:02 AM

    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 ?

  • Jeremy Kemper

    Jeremy Kemper May 19th, 2009 @ 07:17 PM

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

  • Jeremy Kemper

    Jeremy Kemper May 19th, 2009 @ 08:24 PM

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

  • sidcarter
  • fdgpdsjfgj

    fdgpdsjfgj January 2nd, 2011 @ 02:37 PM

    • 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.

  • fdgpdsjfgj

    fdgpdsjfgj January 2nd, 2011 @ 02:39 PM

    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.

  • fdgpdsjfgj

    fdgpdsjfgj January 2nd, 2011 @ 02:40 PM

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

  • bingbing
  • csnk

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages