##"rails test"の実行時に警告
Rails Tutorialを進めている時、"rails test"の実行時に以下の警告が発生。
ec2-user:~/environment/sample_app (static-pages) $ rails test
Running via Spring preloader in process 3766
/usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/command.rb:18: warning: already initialized constant Rails::Command::HELP_MAPPINGS
/usr/local/rvm/gems/ruby-2.4.1@global/gems/railties-5.1.4/lib/rails/command.rb:18: warning: previous definition of HELP_MAPPINGS was here
Run options: --seed 27582
# Running:
Run options: --seed 27582
# Running:
......
Finished in 0.384025s, 7.8120 runs/s, 7.8120 assertions/s.
3 runs, 3 assertions, 0 failures, 0 errors, 0 skips
/usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier/tmux/client.rb:12:in `version': undefined method `[]' for nil:NilClass (NoMethodError)
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier/tmux.rb:69:in `_check_available'
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier/base.rb:59:in `initialize'
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:100:in `new'
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:100:in `_add'
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:62:in `block (2 levels) in detect'
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:60:in `each'
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:60:in `detect'
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:60:in `block in detect'
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:59:in `each'
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:59:in `detect'
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier.rb:180:in `_detect_or_add_notifiers'
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier.rb:198:in `_activate'
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier.rb:87:in `initialize'
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier.rb:42:in `new'
from /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier.rb:42:in `connect'
from /usr/local/rvm/gems/ruby-2.4.1/gems/guard-2.13.0/lib/guard/notifier.rb:11:in `connect'
from /usr/local/rvm/gems/ruby-2.4.1/gems/guard-2.13.0/lib/guard/notifier.rb:31:in `notify'
from /usr/local/rvm/gems/ruby-2.4.1/gems/guard-compat-1.2.1/lib/guard/compat/plugin.rb:113:in `notify'
from /usr/local/rvm/gems/ruby-2.4.1/gems/guard-minitest-2.4.4/lib/guard/minitest/notifier.rb:31:in `notify'
from /usr/local/rvm/gems/ruby-2.4.1/gems/guard-minitest-2.4.4/lib/guard/minitest/reporter.rb:10:in `report'
from /usr/local/rvm/gems/ruby-2.4.1/gems/minitest-5.11.1/lib/minitest.rb:791:in `each'
from /usr/local/rvm/gems/ruby-2.4.1/gems/minitest-5.11.1/lib/minitest.rb:791:in `report'
from /usr/local/rvm/gems/ruby-2.4.1/gems/minitest-5.11.1/lib/minitest.rb:141:in `run'
from /usr/local/rvm/gems/ruby-2.4.1/gems/minitest-5.11.1/lib/minitest.rb:63:in `block in autorun'
from /usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:171:in `fork'
from /usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:171:in `serve'
from /usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
from /usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
from /usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
from /usr/local/rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
やりたいtest自体は実行できているので、警告は無視しても問題なさそうだけど、
形にこだわる自分としては何とかしたい衝動が抑えられない
警告はこの辺をピンポイントで調べていけば解決するのかな・・・?
/usr/local/rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/command.rb
/usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier/tmux/client.rb
解決したら追記する
##追記 2018.02.10
ログの最後の方に出力されていた警告は解決(?)しました。
こちらを参考にさせていただきました
原因は結局わからないままモヤッとボールを投げまくりたい感じですが・・・。
RailsTutorialで記載されているgemにTMuxが含まれていないけど、
Testを実行する上では必要でTmux無いよ!って警告だったのかな?
警告に記載ある「notiffany」はどうやら通知機能を提供しているようで、
GitHubを覗いてみるとREADMEにはTMuxのキーワードがあった。
RailsTutorialのTest結果を表示するにはTMuxを利用していたのかな、と。