没有要加载的文件——rdoc/task
当我运行时,
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我也有同样的问题。
我通过将
gem 'rdoc'
添加到我的 Gemfile 中,然后运行 bundle install
解决了这个问题。I had the same problem.
I solved it by adding
gem 'rdoc'
to my Gemfile and then runbundle install
.如果您没有使用 Gemfile,则将 Rakefile 中的行从 this: 切换
到 this
可能会起作用。它对我有用。
还可以尝试一个
If you're not using a Gemfile, it's likely that switching your line in your Rakefile from this:
to this
will work. It did for me.
Also try a
如果环境之间有不同的 rake 版本,您实际上可以在 Rakefile 中捕获此问题。我们对旧的生产应用程序就是这样。
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.
如果您正在开发没有 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