关于ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc
来源:互联网 发布:方舟生存进化优化驱动 编辑:程序博客网 时间:2024/05/29 23:44
先理解一下rake:
Rake(http://rake.rubyforge.org)是一门构建语言,和make(www.gnu.org/software/make/)
ant(http://ant.apache.org)很想象。Rake是用Ruby写的,它支持它自己的DSL用来处理和维护
Ruby应用程序。Rails用rake的扩展来完成多种不同的任务。下面的一些在Rails用的最多的Rake任务。
正在学习《agile web development with rails》
之前在我的环境中运行了rails3.2版本下的程序,然后回到rails 3.0版本下的代码尝试运行
bundle install后 执行rake命令数据库迁移,得到如下错误
ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead.
/home/www/.gem/ruby/1.9.1/gems/rake-10.0.4/lib/rake/rdoctask.rb:1:in `<top (required)>'
/home/www/.gem/ruby/1.9.1/gems/railties-3.0.5/lib/rails/tasks/documentation.rake:1:in `require'
/home/www/.gem/ruby/1.9.1/gems/railties-3.0.5/lib/rails/tasks/documentation.rake:1:in `<top (required)>'
/home/www/.gem/ruby/1.9.1/gems/railties-3.0.5/lib/rails/tasks.rb:15:in `load'
/home/www/.gem/ruby/1.9.1/gems/railties-3.0.5/lib/rails/tasks.rb:15:in `block in <top (required)>'
/home/www/.gem/ruby/1.9.1/gems/railties-3.0.5/lib/rails/tasks.rb:6:in `each'
/home/www/.gem/ruby/1.9.1/gems/railties-3.0.5/lib/rails/tasks.rb:6:in `<top (required)>'
/home/www/.gem/ruby/1.9.1/gems/railties-3.0.5/lib/rails/application.rb:213:in `require'
/home/www/.gem/ruby/1.9.1/gems/railties-3.0.5/lib/rails/application.rb:213:in `initialize_tasks'
/home/www/.gem/ruby/1.9.1/gems/railties-3.0.5/lib/rails/application.rb:139:in `load_tasks'
/home/www/.gem/ruby/1.9.1/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
/home/www/code/rails30/depot_r/Rakefile:7:in `<top (required)>'
/home/www/.gem/ruby/1.9.1/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load'
/home/www/.gem/ruby/1.9.1/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/www/.gem/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:589:in `raw_load_rakefile'
/home/www/.gem/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:89:in `block in load_rakefile'
/home/www/.gem/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/home/www/.gem/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:88:in `load_rakefile'
/home/www/.gem/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:72:in `block in run'
/home/www/.gem/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/home/www/.gem/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
这里说 rake/rdoctask 已经被废弃,用rdoc/task代替,用的是新版本的rake,这里的rodc/task指的是什么,没有理解,为什么新版本的rake会提示引用的库已经废弃,goole了解决方案,改写Gemfile.lock文件,将使用的rake降级为0.8.7,然后执行rake 有出现如下错误:
You have already activated rake 10.0.3, but your Gemfile requires rake 0.8.7. Using bundle exec may solve this.
/home/www/code/rails30/depot_r/config/boot.rb:22:in `<top (required)>'
/home/www/code/rails30/depot_r/config/application.rb:17:in `<top (required)>'
/home/www/code/rails30/depot_r/Rakefile:4:in `<top (required)>'
在外国的论坛上找到了解决问题的方法:
The problem is that when you have multiple versions of the same gem installed, the binary you will executerake
is always the latest version. If your application then depends on an older version of that gem, it can't activate it, since the newer version is already loaded.
There are three solutions:
- use
bundle exec rake
this will always use the version from your Gemfile - use bundler binstubs:
bundle --binstubs
. This creates a./bin
folder in your project. You can now access the binaries for the specified gem versions from your Gemfile. You can call rake with./bin/rake
- uninstall the newer version so that the binary points to the one in your Gemfile
我用了 bundle exec rake db:migrate 执行了 数据库迁移 执行成功
- 关于ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc
- Error: Running Homebrew as root is extremely dangerous and no longer supported.
- ERROR: JVMPI, an experimental interface, is no longer supported.
- OSX 10.9 Compile error: garbage collection is no longer supported
- rails的rake出错,认不到RDoc,该如何处理
- xvim garbage collection is no longer supported
- garbage collection is no longer supported
- NDK开发之------Error: Flag android.useDeprecatedNdk is no longer supported爬坑
- mac下面通过brew安装东西的时候报Error: Running Homebrew as root is extremely dangerous and no longer supported的解决
- php7.0 出现 curl_setopt(): Disabling safe uploads is no longer supported in 报错!
- Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported in Unity 5.
- php7.0 出现 curl_setopt(): Disabling safe uploads is no longer supported in 报错!
- php7.0 出现 curl_setopt(): Disabling safe uploads is no longer supported in 报错!
- Rdoc生成类图
- PuTTY error: "No supported authentication methods available"
- 安装cocos2d提示'root' is no longer supported解决方法
- cocos2d 'root' is no longer supported问题解决办法
- JVMPI, an experimental interface, is no longer supported.
- 举例书写Makefile文件(C语言)
- 获取手机上的联系人的详细信息
- 润乾报表—动态设置滚动条适应屏幕分辨率
- 数 据 库 设 计 经 验 谈1
- MAC OS X下编译tesseract
- 关于ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc
- *** glibc detected *** /home/app: corrupted double-linked list: 0x08b08918 ***
- 简单的随机抽取系统--html--js
- 搭建postgres开发环境
- MySQL的 compound-statement SQL
- android webview的一些设置问题
- hdu 3555
- 定时器定时1us可能不能实现
- redmine 插件安装