いままでwindows上のローカル環境でRails Tutorialを勉強していたのですが、windowsをアップデートしたところエラーが出るようになってしまったため、Cloud9に今まで進めていたsample app(現在第12章終了時点です)をBitbucketからコピーしてきました。
Git cloneでCloud9上にコピーして、
bundle install --without production
rails db:migrate
rails test
と実行したところで以下のようなメッセージが出ました。
ec2-user:~/rails-tutorial/sample_app09 (master) $ rails test Running via Spring preloader in process 17421 Started with run options --seed 43192 41/41: [=============================================================================================================] 100% Time: 00:00:07, Time: 00:00:07 Finished in 7.13687s 41 tests, 188 assertions, 0 failures, 0 errors, 0 skips Traceback (most recent call last): 34: from -e:1:in `<main>' 33: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' 32: from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' 31: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>' 30: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/application.rb:135:in `run' 29: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop' 28: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run' 27: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/application.rb:171:in `serve' 26: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.0.2/lib/spring/application.rb:171:in `fork' 25: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/minitest-5.10.3/lib/minitest.rb:63:in `block in autorun' 24: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/railties-5.1.2/lib/rails/test_unit/minitest_plugin.rb:77:in `run' 23: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/minitest-5.10.3/lib/minitest.rb:141:in `run' 22: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/minitest-5.10.3/lib/minitest.rb:687:in `report' 21: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/minitest-5.10.3/lib/minitest.rb:687:in `each' 20: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/guard-minitest-2.4.4/lib/guard/minitest/reporter.rb:10:in `report' 19: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/guard-minitest-2.4.4/lib/guard/minitest/notifier.rb:31:in `notify' 18: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/guard-compat-1.2.1/lib/guard/compat/plugin.rb:113:in `notify' 17: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/guard-2.13.0/lib/guard/notifier.rb:31:in `notify' 16: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/guard-2.13.0/lib/guard/notifier.rb:11:in `connect' 15: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier.rb:42:in `connect' 14: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier.rb:42:in `new' 13: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier.rb:87:in `initialize' 12: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier.rb:198:in `_activate' 11: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier.rb:180:in `_detect_or_add_notifiers' 10: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:59:in `detect' 9: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:59:in `each' 8: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:60:in `block in detect' 7: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:60:in `detect' 6: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:60:in `each' 5: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:62:in `block (2 levels) in detect' 4: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:100:in `_add' 3: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier/detected.rb:100:in `new' 2: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier/base.rb:59:in `initialize' 1: from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier/tmux.rb:69:in `_check_available' /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/notiffany-0.1.1/lib/notiffany/notifier/tmux/client.rb:12:in `version': undefined method `[]' for nil:NilClass (NoMethodError)
テスト自体は正常に実行できているのですが、Traceback(most recent call last):というメッセージ以降が今までなかったもので何が原因か分かりません。
また、rails serverを実行してブラウザを開くと、新しいタブにはsample appのページが表示されるのですが、Cloud9上のブラウザーセクションには「接続が拒否されました」と出て表示されません。
分かる方がいらっしゃったら教えてください。よろしくお願いします。
回答頂いたgemfileの内容は以下の通りです。testの中にguardが含まれています。
source 'https://rubygems.org' gem 'rails', '5.1.2' gem 'bootstrap-sass', '3.3.7' gem 'bcrypt', '3.1.11' gem 'faker', '1.7.3' gem 'will_paginate', '3.1.6' gem 'bootstrap-will_paginate', '1.0.0' gem 'puma', '3.9.1' gem 'sass-rails', '5.0.6' gem 'uglifier', '3.2.0' gem 'coffee-rails', '4.2.2' gem 'jquery-rails', '4.3.1' gem 'turbolinks', '5.0.1' gem 'jbuilder', '2.7.0' group :development, :test do gem 'sqlite3', '1.3.13' gem 'byebug', '9.0.6', platform: :mri end group :development do gem 'web-console', '3.5.1' gem 'listen', '3.0.8' gem 'spring', '2.0.2' gem 'spring-watcher-listen', '2.0.1' end group :test do gem 'rails-controller-testing', '1.0.2' gem 'minitest-reporters', '1.1.14' gem 'guard', '2.13.0' gem 'guard-minitest', '2.4.4' end group :production do gem 'pg', '0.18.4' end # Windows環境ではtzinfo-dataというgemを含める必要があります gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
回答1件
あなたの回答
tips
プレビュー