没有这样的文件加载 - rdoc/task

Jar*_*red 16 rake rubygems ruby-on-rails rdoc

我跑的时候

rake db:create
Run Code Online (Sandbox Code Playgroud)

我收到此错误

rake aborted!
no such file to load -- rdoc/task

(See full trace by running task with --trace)
Run Code Online (Sandbox Code Playgroud)

这是--trace

/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/home/tpeg/rails_apps/Test/Rakefile:8
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:495:in `raw_load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:78:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:77:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:61:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Run Code Online (Sandbox Code Playgroud)

我安装了rake 0.9.2和rdoc 3.11.我在我的应用程序目录中运行这些命令.

小智 27

我有同样的问题.

我通过添加gem 'rdoc'到我的Gemfile然后运行来解决它bundle install.


Nea*_*eal 12

如果你没有使用Gemfile,很可能会在你的Rakefile中切换你的行:

require 'rake/rdoctask'
Run Code Online (Sandbox Code Playgroud)

对此

require 'rdoc/task'
Run Code Online (Sandbox Code Playgroud)

将工作.它对我有用.

也尝试一下

gem install rdoc
Run Code Online (Sandbox Code Playgroud)