没有要加载的文件——rdoc/task

发布于 2024-12-10 19:59:56 字数 1350 浏览 0 评论 0原文

当我运行时,

rake db:create

我收到此错误

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

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

这是 --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

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

When I run

rake db:create

I receive this error

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

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

Here is the --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

I have rake 0.9.2 and rdoc 3.11 installed. I am running these commands in my app's directory.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

水中月 2024-12-17 19:59:56

我也有同样的问题。

我通过将 gem 'rdoc' 添加到我的 Gemfile 中,然后运行 ​​bundle install 解决了这个问题。

I had the same problem.

I solved it by adding gem 'rdoc' to my Gemfile and then run bundle install.

深府石板幽径 2024-12-17 19:59:56

如果您没有使用 Gemfile,则将 Rakefile 中的行从 this: 切换

require 'rake/rdoctask'

到 this

require 'rdoc/task'

可能会起作用。它对我有用。

还可以尝试一个

gem install rdoc

If you're not using a Gemfile, it's likely that switching your line in your Rakefile from this:

require 'rake/rdoctask'

to this

require 'rdoc/task'

will work. It did for me.

Also try a

gem install rdoc
岁月静好 2024-12-17 19:59:56

如果环境之间有不同的 rake 版本,您实际上可以在 Rakefile 中捕获此问题。我们对旧的生产应用程序就是这样。

begin
  require 'rake/rdoctask'
rescue
  require 'rdoc/task'
end

You can actually trap for this in your Rakefile should you have different rake versions between environments. We are this way with older production applications.

begin
  require 'rake/rdoctask'
rescue
  require 'rdoc/task'
end
橘虞初梦 2024-12-17 19:59:56

如果您正在开发没有 Gemfile 的应用程序(例如使用 Rails 2.3 的旧版 --),您可以手动安装 gem rdoc:

gem install rdoc

If you're working on an app without a Gemfile (like a legacy with rails 2.3 --), you can install the gem rdoc manually:

gem install rdoc

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文