微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

为什么在运行rails test时遇到binding.pry或byebug后不能输入终端?

如何解决为什么在运行rails test时遇到binding.pry或byebug后不能输入终端?

在为Rails应用程序运行测试套件时,每当我碰到binding.prybyebug时,我的终端就会被破坏-回应到终端的不是我在键入什么,使事情恢复正常的唯一方法是中断进程并运行reset

任何想法可能是什么问题?我不确定从哪里开始。

这是我的Gemfile:

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

gem 'rails','6.0.2.1'
gem 'puma','3.12.2'
gem 'sass-rails','5.1.0'
gem 'webpacker','4.0.7'
gem 'turbolinks','5.2.0'
gem 'jbuilder','2.9.1'
gem 'bootsnap','1.4.5',require: false
gem 'bootstrap-sass','3.4.1'
gem 'pry'
gem 'pry-rails'
gem 'bcrypt','3.1.13'

group :development,:test do
  gem 'sqlite3','1.4.1'
  gem 'byebug','11.0.1',platforms: [:mri,:mingw,:x64_mingw]
end

group :development do
  gem 'web-console','4.0.1'
  gem 'listen','3.1.5'
  gem 'spring','2.1.0'
  gem 'spring-watcher-listen','2.0.1'
end

group :test do
  gem 'capybara','3.28.0'
  gem 'selenium-webdriver','3.142.4'
  gem 'webdrivers','4.1.2'
  gem 'rails-controller-testing','1.0.4'
  gem 'minitest','5.11.3'
  gem 'minitest-reporters','1.3.8'
  gem 'guard','2.15.0'
  gem 'guard-minitest','2.4.6'
end

group :production do
  gem 'pg','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]

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

# ruby '2.7.1'

# # Bundle edge Rails instead: gem 'rails',github: 'rails/rails'
# gem 'rails','~> 6.0.3','>= 6.0.3.2'
# # Use sqlite3 as the database for Active Record
# gem 'sqlite3','~> 1.4'
# # Use Puma as the app server
# gem 'puma','~> 4.1'
# # Use SCSS for stylesheets
# gem 'sass-rails','>= 6'
# # 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',:x64_mingw]
# end

# group :development do
#   # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
#   gem 'web-console','>= 3.3.0'
#   gem 'listen','~> 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

# # Windows does not include zoneinfo files,so bundle the tzinfo-data gem
# gem 'tzinfo-data',:jruby]

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。