gpt4 book ai didi

ruby-on-rails - 运行 "rails test"会抛出 Bad file descriptor (Errno::EBADF) 错误

转载 作者:行者123 更新时间:2023-12-04 02:44:18 25 4
gpt4 key购买 nike

我正在使用 Rails 6。我按照“https://www.learnenough.com/ruby-on-rails-4th-edition-tutorial”中的教程开发了一个示例 Rails 应用程序。但是,当我尝试运行“rails test”时,它会抛出Bad file descriptor (Errno::EBADF) 错误

我的 GEM 文件:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.5.0'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false

group :development, :test do

# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
# Use mysql2 as the database for Active Record
gem 'mysql2', '~> 0.5.2'
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end

group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
end

group :production do
gem 'pg', '~> 1.1', '>= 1.1.4'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

我在运行“rails test”时得到的错误是

Running via Spring preloader in process 6349
Run options: --seed 17984

# Running:

.Traceback (most recent call last):
Traceback (most recent call last):
28: from -e:1:in `<main>'
27: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
26: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
28: from -e:1:in `<main>'
25: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>'
27: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
24: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `run'
26: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
23: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop'
25: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>'
22: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run'
24: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `run'
23: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop'
21: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:175:in `serve'
22: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run'
20: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:175:in `fork'
21: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:175:in `serve'
19: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun'
20: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:175:in `fork'
18: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/minitest-5.11.3/lib/minitest.rb:133:in `run'
19: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun'
17: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `start'
Traceback (most recent call last):
16: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `map'
15: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `each'
18: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/minitest-5.11.3/lib/minitest.rb:133:in `run'
14: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `times'
17: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `start'
16: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `map'
15: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `each'
13: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:75:in `block in start'
14: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `times'
13: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:75:in `block in start'
12: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:75:in `fork'
11: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:95:in `block (2 levels) in start'
10: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1139:in `method_missing'
28: from -e:1:in `<main>'
9: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1159:in `with_friend'
12: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:75:in `fork'
8: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1140:in `block in method_missing'
7: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1214:in `open'
27: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
6: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1214:in `synchronize'
11: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:95:in `block (2 levels) in start'
10: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1139:in `method_missing'
9: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1159:in `with_friend'
8: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1140:in `block in method_missing'
7: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1214:in `open'
6: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1214:in `synchronize'
5: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1217:in `block in open'
4: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1217:in `each'
26: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
3: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1219:in `block (2 levels) in open'
25: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>'
5: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1217:in `block in open'
4: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1217:in `each'
24: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `run'
2: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1263:in `alive?'
3: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1219:in `block (2 levels) in open'
23: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop'
2: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1263:in `alive?'
22: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run'
1: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1006:in `alive?'
21: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:175:in `serve'
/Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1006:in `wait_readable' 20: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:175:in `fork'
: 1: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1006:in `alive?'
Bad file descriptor/Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1006:in `wait_readable': (Bad file descriptor 19: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun'
(Errno::EBADFErrno::EBADF 18: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/minitest-5.11.3/lib/minitest.rb:133:in `run'
17: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `start'
)
)
16: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `map'
15: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `each'
14: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `times'
13: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:75:in `block in start'
12: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:75:in `fork'
11: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:95:in `block (2 levels) in start'
10: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1139:in `method_missing'
9: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1159:in `with_friTraceback (most recent call last):
Traceback (most recent call last):
end'
Traceback (most recent call last):
8: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1140:in `block in method_missing'
7: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1214:in `open'
6: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1214:in `synchronize'
28: from -e:1:in `<main>'
5: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1217:in `block in open'
28: from -e:1:in `<main>'
27: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
4: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1217:in `each'
28: from -e:1:in `<main>'
26: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
3: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1219:in `block (2 levels) in open'
27: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
2: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1263:in `alive?'
27: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
1: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1006:in `alive?'
/Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1006:in `wait_readable' 26: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
: 25: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>'
25: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>'
26: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
24: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `run'
Bad file descriptor ( 23: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop'
25: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>'
22: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run'
Errno::EBADF 24: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `run'
21: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:175:in `serve'
23: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop'
)
20: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:175:in `fork'
22: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run'
19: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun'
24: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `run'
21: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:175:in `serve'
18: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/minitest-5.11.3/lib/minitest.rb:133:in `run'
20: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:175:in `fork'
17: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `start'
19: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun'
23: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop'
16: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `map'
18: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/minitest-5.11.3/lib/minitest.rb:133:in `run'
15: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `each'
17: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `start'
14: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `times'
16: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `map'
13: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:75:in `block in start'
15: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `each'
14: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `times'
13: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:75:in `block in start'
12: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:75:in `fork'
11: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:95:in `block (2 levels) in start'
10: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1139:in `method_missing'
9: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1159:in `with_friend'
8: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1140:in `block in method_missing'
7: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1214:in `open'
22: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run'
6: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1214:in `synchronize'
21: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:175:in `serve'
5: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1217:in `block in open'
20: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/application.rb:175:in `fork'
4: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1217:in `each'
19: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun'
3: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1219:in `block (2 levels) in open'
18: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/minitest-5.11.3/lib/minitest.rb:133:in `run'
12: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:75:in `fork'
11: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:95:in `block (2 levels) in start'
10: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1139:in `method_missing'
9: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1159:in `with_friend'
8: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1140:in `block in method_missing'
7: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1214:in `open'
6: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1214:in `synchronize'
2: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1263:in `alive?'
5: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1217:in `block in open'
4: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1217:in `each'
3: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1219:in `block (2 levels) in open'
2: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1263:in `alive?'
1: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1006:in `alive?'
/Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1006:in `wait_readable': Bad file descriptor (Errno::EBADF)
1: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1006:in `alive?'
/Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1006:in `wait_readable': Bad file descriptor (Errno::EBADF)
17: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `start'
16: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `map'
15: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `each'
14: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:74:in `times'
13: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:75:in `block in start'
12: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:75:in `fork'
11: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:95:in `block (2 levels) in start'
10: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1139:in `method_missing'
9: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1159:in `with_friend'
8: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1140:in `block in method_missing'
7: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1214:in `open'
6: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1214:in `synchronize'
5: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1217:in `block in open'
4: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1217:in `each'
3: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1219:in `block (2 levels) in open'
2: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1263:in `alive?'
1: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1006:in `alive?'
/Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/drb/drb.rb:1006:in `wait_readable': Bad file descriptor (Errno::EBADF)
Traceback (most recent call last):
5: from -e:1:in `<main>'
4: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
3: from /Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
2: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun'
1: from /Users/deepak/.rvm/gems/ruby-2.5.0/gems/minitest-5.11.3/lib/minitest.rb:140:in `run'
/Users/deepak/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:118:in `shutdown': Queue not empty, but all workers have finished. This probably means that a worker crashed and 8 tests were missed. (RuntimeError)

注意:我已将默认环境设置为测试,然后运行我的应用程序。

最佳答案

在您的 /test/test_helper.rb 文件中,删除并行测试。您的文件应该类似于:

ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require 'rails/test_help'

class ActiveSupport::TestCase
# Run tests in parallel with specified workers
# OLD: parallelize(workers: :number_of_processors) <--
parallelize(workers: 1) # i.e don't run tests in parallel via forked processes
# OR just comment the line above out completely <--

# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all

# Add more helper methods to be used by all tests here...
end

关于ruby-on-rails - 运行 "rails test"会抛出 Bad file descriptor (Errno::EBADF) 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57863565/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com