当我做bundle exec rake -T次(或bundle exec rake次)时,我会收到弃用警告:

Andrews-Air:nabu agrimm$ bundle exec rake --trace -T
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
rake about                               # List versions of all Rails frameworks and the environment
[snip]

虽然不是很相关,但这里有一个文件:

source 'https://rubygems.org'

gem 'rails', '~> 3.2.22.2'

gem 'mysql2'

group :assets do
  gem 'coffee-rails', '~> 3.2.1'
  gem 'compass-rails'

  gem 'therubyracer'
  gem 'libv8'

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'
gem 'haml-rails'
gem 'to-csv', :require => 'to_csv'
gem 'kaminari'
gem 'oai'
gem 'analytical'

gem 'country-select'
gem 'activeadmin'
gem 'sass-rails',  '~> 3.2.3'
gem 'meta_search', '>= 1.1.0.pre'

gem 'devise', '2.2.3'
gem 'cancancan', '~> 1.12.0'

gem 'squeel'
gem 'nilify_blanks'

gem 'sunspot_rails'
gem 'sunspot_solr'

gem 'unicorn'

gem 'ruby-filemagic'

gem 'capistrano'
gem 'capistrano-ext'
gem 'capistrano-unicorn'

gem 'rollbar', '~> 2.8.3'
gem 'newrelic_rpm'

gem 'progress_bar'
gem 'paper_trail', '~> 2'
gem 'quiet_assets'
gem 'roo', '~> 2.1.0'
gem 'roo-xls', :github => 'roo-rb/roo-xls', :ref => '0a5ef88'
gem 'streamio-ffmpeg'
gem 'rake'

gem 'rmagick'

gem 'whenever', :require => false

group :development, :test do
  gem 'turn', '~> 0.8.3', :require => false
  gem 'rspec-rails', '~> 2.0'
  gem 'sextant'
  gem 'thin'

  gem 'spring'
  gem 'spring-commands-rspec'

  gem 'pry'
  gem 'pry-rails'

  gem 'letter_opener'

  gem 'guard-bundler'
  gem 'guard-rails'
  gem 'guard-rspec'
  gem 'guard-sunspot'

  gem 'rb-inotify', :require => RUBY_PLATFORM.include?('linux') ? 'rb-inotify' : false
  gem 'rb-fsevent', :require => RUBY_PLATFORM.include?('darwin') ? 'rb-fsevent' : false
end

group :development do
  gem 'annotate'
  gem 'binding_of_caller'
  gem 'better_errors'
  gem 'rubocop'
end

group :test do
  gem 'capybara'
  gem 'poltergeist'
  gem 'factory_girl_rails'
  gem 'database_cleaner'
  gem 'email_spec'
  gem 'launchy'
end

git grep -i last_comment表示它不在我的代码中——可能是在第三方的gem中.

我如何找出导致弃用警告的原因?

推荐答案

我发现在rake-11.1.0/lib/rake/task_manager.rb:10中把线从warn改成raise更容易.

对我来说,令人不快的Ruby 是rspec(fixed in 3.4.4)和rubocop(fixed in 0.38.0).

Ruby-on-rails相关问答推荐

%i 或 %I 在 Ruby 中做什么?

Dotenv 多行变量

Ruby中的`try`和`&.`(安全导航运算符)有什么区别

如何将 SQL 文件导入 Rails 数据库?

在 Ruby 中拆分多行的长字符串而不去除换行符

Ruby 中 as_json 和 to_json 方法的区别

Rails 5,Rspec:架构中未找到环境数据

从 before_action 中排除控制器

如何更改 Heroku 应用程序的 DATABASE_URL

Rails 5:无法从参数中检索哈希值

在 Rails 的 ActiveRecord 中,touch 有什么用?

错误原始错误:未安装 ImageMagick/GraphicsMagick

CAS 与 SAML 与 OAuth2

Pages#home 中的 Rails ExecJS::ProgramError?

安装坚固耐用时发生错误

从 ActiveRecord 模型中获取特定属性

从 Rails 控制台发送邮箱

如何解决错误“‘生产’环境缺少‘secret_key_base’”(Rails 4.1)

当我运行Bundle 安装时,Nokogiri '无法构建 gem 本机扩展'

如何从 Sidekiq 清除所有作业(job)?