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.

[PATCH] Rake doc:rails Failing

#3697

Rake task doc:rails fails with the following output when running from a newly created Rails 3.0.pre project:

$ rake doc:rails

rm -r doc/api
rake aborted!
Don't know how to build task 'vendor/rails/railties/CHANGELOG'

(See full trace by running task with --trace)

Reported by codehugger · January 15th, 2010 @ 02:09 PM

State: resolved
Milestone: 3.0.2
Assigned to: Rizwan Reza Rizwan Reza
Importance: Medium

Activity

  1. codehugger
    codehugger
    • Tag changed from doc, rails3, rake, tasks to bugmash, doc, rails3, rake, tasks

    January 15th, 2010 @ 02:13 PM

  2. Rishav Rastogi
    Rishav Rastogi

    Problem exists with ruby 1.8.7 and ruby 1.9.1

    January 16th, 2010 @ 07:44 AM

  3. Rizwan Reza
    Rizwan Reza

    The problem is that rails is not in the vendor directory. This works if you try after pasting rails dir in vendor.

    January 16th, 2010 @ 08:15 AM

  4. codehugger
    codehugger

    I am using an installed version of rails 3.0.pre (by means of rake install from source directory)

    January 18th, 2010 @ 02:15 PM

  5. makevoid
    makevoid
    • Tag changed from bugmash, doc, rails3, rake, tasks to bugmash, bundler, doc, rails3, rake, tasks

    The problem is that rails is not in the vendor directory. This works if you try after pasting rails dir in vendor.

    Rizwan you are right, putting rails in vendor/rails will generate the doc, but bundler links already rails into vendor/gems/ruby/#{version}/gems..., could rake pick from it?

    January 23rd, 2010 @ 07:40 AM

  6. Rizwan Reza
    Rizwan Reza
    • Milestone cleared.
    • Tag changed from bugmash, bundler, doc, rails3, rake, tasks to bundler, doc, patch, rails3, rake, tasks
    • State changed from new to verified
    • Assigned user set to José Valim
    • Title changed from rake doc:rails failing to [PATCH] Rake doc:rails Failing

    Attached patch is a revamp of the rake documentation task. Here are some of the changes:

    • It takes bundler into account.
    • It now includes ActiveModel.
    • You can specify Rails path to generate documentation from there.
    • There is an easier way to change versions now.
    • The task itself is refactored a bit, so it's easier to include more paths when needed.

    I've reapplied it to master and generated documentation by both specifying a path and without it.

    January 24th, 2010 @ 09:02 AM

  7. Rizwan Reza
    Rizwan Reza
    • State changed from verified to resolved

    This is now fixed.

    rake doc:rails should work if you've already done gem bundle. If not, you can use rake doc:rails RAILS_PATH="path/to/rails" to generate docs from that rails directory.

    January 24th, 2010 @ 09:19 PM

  8. trevor
    trevor

    this didn't work -

    % rake doc:rails rake aborted!
    Don't know how to build task 'vendor/gems/gems/actionmailer-3.0.pre/README'

    this does -

    % rake doc:rails RAILS_PATH="vendor/gems/ruby/1.9.1/gems/rails-3.0.pre"

    January 29th, 2010 @ 10:54 PM

  9. Rizwan Reza
    Rizwan Reza

    That's the reason why I had to alter the task to have a RAILS_PATH argument. Until Bundler is not finalized, I think it's better to keep it as is. I'll surely submit a patch once things get final. Thanks.

    January 29th, 2010 @ 10:59 PM

  10. trevor
    trevor

    seems to have changed when moving to rails 3.0.0.beta. when installing the gems, the rdoc for the libraries are generated, and for rails and railties i get this error through gem server:

    `/doc_root/rails-3.0.0.beta/rdoc/index.html' not found. 
    `/doc_root/railties-3.0.0.beta/rdoc/index.html' not found.
    

    trying to generate via doc:rails isn't working for me -

    % rails -v
    Rails 3.0.0.beta
    % ruby -v
    ruby 1.9.2dev (2010-02-03 trunk 26544) [x86_64-darwin10.2.0]
    % rails myapp
    % cd myapp
    % rake doc:rails
    rake aborted!
    Don't know how to build task 'vendor/gems/gems/actionmailer-3.0.0.beta/README'
    /usr/local/lib/ruby/1.9.1/rake.rb:1720:in []'
    /usr/local/lib/ruby/1.9.1/rake.rb:603:inblock in invoke_prerequisites'
    % mkdir -p vendor/gems/gems
    % cp -R /usr/local/lib/ruby/gems/1.9.1/gems/*.beta vendor/gems/gems
    % mv vendor/gems/gems/actionmailer-3.0.0.beta vendor/gems/gems/actionmailer
    % mv vendor/gems/gems/actionpack-3.0.0.beta vendor/gems/gems/actionpack
    % mv vendor/gems/gems/activemodel-3.0.0.beta vendor/gems/gems/activemodel
    % mv vendor/gems/gems/activerecord-3.0.0.beta vendor/gems/gems/activerecord
    % mv vendor/gems/gems/activeresource-3.0.0.beta vendor/gems/gems/activeresource
    % mv vendor/gems/gems/activesupport-3.0.0.beta vendor/gems/gems/activesupport
    % mv vendor/gems/gems/rails-3.0.0.beta vendor/gems/gems/rails
    % mv vendor/gems/gems/railties-3.0.0.beta vendor/gems/gems/railties
    % rake doc:rails RAILS_PATH="vendor/gems/gems"
    rake aborted!
    Don't know how to build task 'vendor/gems/gems/railties/MIT-LICENSE'
    /usr/local/lib/ruby/1.9.1/rake.rb:1720:in []'
    /usr/local/lib/ruby/1.9.1/rake.rb:603:inblock in invoke_prerequisites'
    

    February 9th, 2010 @ 02:52 PM

  11. Rizwan Reza
    Rizwan Reza
    • State changed from resolved to open

    February 12th, 2010 @ 12:31 PM

  12. José Valim
    José Valim
    • Assigned user changed from José Valim to Rizwan Reza

    Bundler paths should not change from now on. Rizwan, can you please provide a new patch? Please assign to me when you are done.

    February 16th, 2010 @ 11:28 PM

  13. Rizwan Reza
    Rizwan Reza

    I will provide a new patch.

    Currently, I see that vendor/cache has all the .gems files, rather than open
    directories as before. Also, though I see docs in my /usr/local/lib/.../gems
    area, I don't think it's okay to use that path, isn't it? Any ideas?

    February 17th, 2010 @ 08:12 AM

  14. José Valim
    José Valim

    Couldn't you simply load the "bundler.rb" file at the root of the rails source?

    February 17th, 2010 @ 08:19 AM

  15. Rizwan Reza
    Rizwan Reza
    • State changed from open to verified

    Thanks to Yehuda for the API help on Bundler, the attached patch now supports Bundler. I have tested it by both providing a path to rails edge and with installed rails 3 beta gems. Also, I have removed the need of environment variable RAILS_PATH that I added before, it is not needed anymore.

    This applies cleanly on master.

    March 10th, 2010 @ 06:03 PM

  16. Rizwan Reza
    Rizwan Reza
    • Assigned user changed from Rizwan Reza to José Valim

    March 10th, 2010 @ 06:17 PM

  17. José Valim
    José Valim
    • State changed from verified to committed

    March 11th, 2010 @ 12:46 PM

  18. Rizwan Reza
    Rizwan Reza
    • State changed from committed to open
    • Assigned user changed from José Valim to Rizwan Reza

    Reverted back by Jeremy Kemper. Will work on this one.

    March 27th, 2010 @ 01:43 PM

  19. Rizwan Reza
    Rizwan Reza
    • State changed from open to resolved

    (from [de2b0147d04d5460e576cc21afbb062eb012ea7e]) Reapply Rizwan's patch, but memoize Bundler.load.specs in an ivar. [#3697 [PATCH] Rake doc:rails Failing state:resolved]

    Signed-off-by: wycats wycats@gmail.com
    http://github.com/rails/rails/commit/de2b0147d04d5460e576cc21afbb06...

    March 29th, 2010 @ 01:43 AM

  20. Gabe da Silveira
    Gabe da Silveira

    I haven't had time to dig into this yet, but on beta2 under 1.8.7 with bundled gems cached in vendor/cache I get:

    uninitialized constant RubyToken::AlreadyDefinedToken
    

    Which appears to be a known issue going back several years (http://rubyforge.org//tracker/index.php?func=detail&aid=18026&a...)

    If I have time I'll take a deeper look, but I thought I'd post here in case it's obvious to anyone what the problem is.

    April 12th, 2010 @ 09:48 PM

  21. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to Medium

    October 15th, 2010 @ 11:01 PM