Вопрос

Rake is failing to run after an upgrade to Rails 4 and it was running fine before I upgraded my gems. I am on Ruby 1.9.3. For some reason rdoc doesn't recognize the markup attribute, but I can't find anything about it getting removed or renamed.

This is the error message I am getting.

undefined method `markup=' for #<RDoc::Task:0x007fb4b46be660>

The relevant code snippet (complete deploy.rake not shown)

RollOut::DeployTask.new do |d|
d.test = RSpec::Core::RakeTask.new
d.doc = RDoc::Task.new :doc do |rdoc|
  rdoc.rdoc_files.include('README.md', 'lib/**/*.rb', 'app/**/*.rb')
  rdoc.rdoc_dir = 'target/doc'
  rdoc.markup = 'tomdoc'
end

The complete trace:

> RAILS_ENV=production rake assets:precompile --trace                        
rake aborted!
undefined method `markup=' for #<RDoc::Task:0x007fb4b46be660>
/Users/rust/test_app/lib/tasks/deploy.rake:16:in `block (2 levels) in 
<top (required)>'
/Users/rust/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/rdoc/task.rb:158:in
`initialize'
/Users/rust/test_app/lib/tasks/deploy.rake:14:in `new'
/Users/rust/test_app/lib/tasks/deploy.rake:14:in `block in <top
(required)>'
/Users/rust/roll_out/lib/roll_out/deploy_task.rb:73:in `initialize'
/Users/rust/test_app/lib/tasks/deploy.rake:12:in `new'
/Users/rust/test_app/lib/tasks/deploy.rake:12:in `<top (required)>'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-  
4.0.0/lib/active_support/dependencies.rb:222:in `load'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/activesupport- 
4.0.0/lib/active_support/dependencies.rb:222:in `block in load'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-    
4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-
4.0.0/lib/active_support/dependencies.rb:222:in `load'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/railties- 
4.0.0/lib/rails/engine.rb:641:in `block in run_tasks_blocks'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/railties- 
4.0.0/lib/rails/engine.rb:641:in `each'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/railties- 
4.0.0/lib/rails/engine.rb:641:in `run_tasks_blocks'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/railties- 
4.0.0/lib/rails/application.rb:244:in `run_tasks_blocks'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/railties- 
4.0.0/lib/rails/engine.rb:446:in `load_tasks'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/railties-
4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/rust/test_app/Rakefile:7:in `<top (required)>'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/rake-
10.1.0/lib/rake/rake_module.rb:25:in `load'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/rake-
10.1.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/rake- 
10.1.0/lib/rake/application.rb:637:in `raw_load_rakefile'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/rake- 
10.1.0/lib/rake/application.rb:94:in `block in load_rakefile'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/rake-
10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/rake-
10.1.0/lib/rake/application.rb:93:in `load_rakefile'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/rake- 
10.1.0/lib/rake/application.rb:77:in `block in run'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/rake-
10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/rake-
10.1.0/lib/rake/application.rb:75:in `run'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/gems/rake-10.1.0/bin/rake:33:in `<top 
(required)>'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/bin/rake:23:in `load'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/bin/rake:23:in `<main>'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `eval'
/Users/rust/.rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `<main>'

Does anyone has any idea what could be causing this and/or how to fix it?

Это было полезно?

Решение

The error seems to go away if I add gem 'rdoc' to my gem file. I am not sure why this makes any difference, because it was already a dependency of another gem

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top