[Rails] "rake appdoc" failing on windows

John-Mason P. Shackelford john-mason at shackelford.org
Fri Jan 7 06:38:19 GMT 2005


John,

 > When I run 'rake appdoc' from the top directory of the Rails
 > application, I get the following error:
 >
 > rm -r doc/app
 > rdoc -o doc/app --line-numbers --inline-source
 > --title 'Rails Application Documentation' -T 'html' doc/README_FOR_APP
 > app/controllers/abstract_application.rb
 > app/controllers/projects_controller.rb
 > ....
 >rake aborted!
 >undefined method `exitstatus' for nil:NilClass

I see the same problem from win2k.

I managed to get it to work with the following hack. (Note that this 
includes a modification to rake which may introduce a minor 
incompatiblity into other Rake files which use the RDoc task.)

------------ rdoctask.rb ------------
require 'rake/tasklib'
 >  require 'rdoc/rdoc'
....
# Create the tasks defined by this task lib.
def define
....
<  sh %{rdoc -o #{@rdoc_dir} #{opts} #{@rdoc_files}}
 >  r = RDoc::RDoc.new
 >  r.document(['-o', @rdoc_dir] + option_list + @rdoc_files)
....
def option_list
   result = @options.dup
   result << "--main" << "'#{main}'" if main
   result << "--title" << "'#{title}'" if title
<  result << "-T" << "'#{template}'" if template
 >  result << "-T" << template if template
   result
end

------------ rails Rakefile ------------
Rake::RDocTask.new("appdoc") { |rdoc|
   rdoc.rdoc_dir = 'doc/app'
   rdoc.title    = "Rails Application Documentation"
<  rdoc.options << '--line-numbers --inline-source'
 >  rdoc.options << '--line-numbers' << '--inline-source'
....
Rake::RDocTask.new("apidoc") { |rdoc|
   rdoc.rdoc_dir = 'doc/api'
   rdoc.title    = "Rails Framework Documentation"
<  rdoc.options << '--line-numbers --inline-source'
 >  rdoc.options << '--line-numbers' << '--inline-source'

See http://groups-beta.google.com/group/comp.lang.ruby/msg/24dbdf4680e68493

John-Mason



More information about the Rails mailing list