Shoyan blog

Rails 4.2.7.1 に更新した後に [DEPRECATION] Last_comment Is Deprecated. が発生した

Railsを4.2.7.1にアップデートをしてrspecを実行すると、以下のエラーが発生するようになった。

1
2
3
4
5
6
7
8
9
10
$ bundle exec rspec spec
[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.
......................................................................................................

Finished in 2.33 seconds (files took 8.78 seconds to load)
102 examples, 0 failures

grepしてみたところ、rspecで使用していた。

1
2
3
$ hw last_comment vendor/bundle
vendor/bundle/ruby/2.2.0/gems/rspec-core-3.2.2/lib/rspec/core/rake_task.rb
84:        desc "Run RSpec code examples" unless ::Rake.application.last_comment

rspecをアップデートしたら出なくなった。

1
2
3
4
5
6
7
$ bundle update rspec-rails

$ bundle exec rspec spec
......................................................................................................

Finished in 2.33 seconds (files took 8.85 seconds to load)
102 examples, 0 failures

Comments