Pry gem被击中,但是我无法在控制台中键入任何内容

Tod*_*ddT 0 ruby rubygems ruby-on-rails

它很奇怪,我没有得到任何错误信息,我只是无法使用Pry.在binding.pry被击中,和进程也会停止.但后来我实际上无法使用Pry我尝试输入,但它要么不起作用,要么它的胡言乱语而不是我正在打的关键.

关于如何Pry工作的任何想法?我正在运行Ubuntu 14.04.3 LTS,已安装的宝石列表是:

source 'https://rubygems.org'

gem 'rails', '~>4.2.6'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'shopify_app', '~> 7.2'
gem 'shopify_api'
gem 'puma'
gem 'nokogiri'
gem 'httparty'
gem 'redis'
gem 'redis-namespace'
gem 'redis-rails'
gem 'redis-rack-cache'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'pry'

group :development do
  gem 'spring'
end
Run Code Online (Sandbox Code Playgroud)

然后所有版本号如下:

GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.7.1)
  actionpack (= 4.2.7.1)
  actionview (= 4.2.7.1)
  activejob (= 4.2.7.1)
  mail (~> 2.5, >= 2.5.4)
  rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.7.1)
  actionview (= 4.2.7.1)
  activesupport (= 4.2.7.1)
  rack (~> 1.6)
  rack-test (~> 0.6.2)
  rails-dom-testing (~> 1.0, >= 1.0.5)
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.7.1)
  activesupport (= 4.2.7.1)
  builder (~> 3.1)
  erubis (~> 2.7.0)
  rails-dom-testing (~> 1.0, >= 1.0.5)
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.7.1)
  activesupport (= 4.2.7.1)
  globalid (>= 0.3.0)
activemodel (4.2.7.1)
  activesupport (= 4.2.7.1)
  builder (~> 3.1)
activerecord (4.2.7.1)
  activemodel (= 4.2.7.1)
  activesupport (= 4.2.7.1)
  arel (~> 6.0)
activeresource (4.1.0)
  activemodel (~> 4.0)
  activesupport (~> 4.0)
  rails-observers (~> 0.1.2)
activesupport (4.2.7.1)
  i18n (~> 0.7)
  json (~> 1.7, >= 1.7.7)
  minitest (~> 5.1)
  thread_safe (~> 0.3, >= 0.3.4)
  tzinfo (~> 1.1)
arel (6.0.4)
builder (3.2.3)
coderay (1.1.1)
concurrent-ruby (1.0.4)
erubis (2.7.0)
execjs (2.7.0)
faraday (0.9.2)
  multipart-post (>= 1.2, < 3)
globalid (0.3.7)
  activesupport (>= 4.1.0)
hashie (3.5.1)
httparty (0.14.0)
  multi_xml (>= 0.5.2)
i18n (0.8.0)
jbuilder (2.6.1)
  activesupport (>= 3.0.0, < 5.1)
  multi_json (~> 1.2)
jquery-rails (4.2.2)
  rails-dom-testing (>= 1, < 3)
  railties (>= 4.2.0)
  thor (>= 0.14, < 2.0)
json (1.8.6)
jwt (1.5.1)
loofah (2.0.3)
  nokogiri (>= 1.5.9)
mail (2.6.4)
  mime-types (>= 1.16, < 4)
method_source (0.8.2)
mime-types (3.1)
  mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.10.1)
multi_json (1.12.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nokogiri (1.7.0.1)
  mini_portile2 (~> 2.1.0)
oauth2 (1.1.0)
  faraday (>= 0.8, < 0.10)
  jwt (~> 1.0, < 1.5.2)
  multi_json (~> 1.3)
  multi_xml (~> 0.5)
  rack (>= 1.2, < 3)
omniauth (1.4.1)
  hashie (>= 1.2, < 4)
  rack (>= 1.0, < 3)
omniauth-oauth2 (1.4.0)
  oauth2 (~> 1.0)
  omniauth (~> 1.2)
omniauth-shopify-oauth2 (1.1.17)
  oauth2 (~> 1.1.0)
  omniauth-oauth2 (~> 1.2)
pry (0.10.4)
  coderay (~> 1.1.0)
  method_source (~> 0.8.1)
  slop (~> 3.4)
puma (3.7.0)
rack (1.6.5)
rack-cache (1.6.1)
  rack (>= 0.4)
rack-test (0.6.3)
  rack (>= 1.0)
rails (4.2.7.1)
  actionmailer (= 4.2.7.1)
  actionpack (= 4.2.7.1)
  actionview (= 4.2.7.1)
  activejob (= 4.2.7.1)
  activemodel (= 4.2.7.1)
  activerecord (= 4.2.7.1)
  activesupport (= 4.2.7.1)
  bundler (>= 1.3.0, < 2.0)
  railties (= 4.2.7.1)
  sprockets-rails
rails-deprecated_sanitizer (1.0.3)
  activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.8)
  activesupport (>= 4.2.0.beta, < 5.0)
  nokogiri (~> 1.6)
  rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
  loofah (~> 2.0)
rails-observers (0.1.2)
  activemodel (~> 4.0)
railties (4.2.7.1)
  actionpack (= 4.2.7.1)
  activesupport (= 4.2.7.1)
  rake (>= 0.8.7)
  thor (>= 0.18.1, < 2.0)
rake (12.0.0)
redis (3.3.3)
redis-actionpack (5.0.1)
  actionpack (>= 4.0, < 6)
  redis-rack (>= 1, < 3)
  redis-store (>= 1.1.0, < 1.4.0)
redis-activesupport (5.0.1)
  activesupport (>= 3, < 6)
  redis-store (~> 1.2.0)
redis-namespace (1.5.2)
  redis (~> 3.0, >= 3.0.4)
redis-rack (1.6.0)
  rack (~> 1.5)
  redis-store (~> 1.2.0)
redis-rack-cache (2.0.0)
  rack-cache (~> 1.6.0)
  redis-store (~> 1.2.0.pre)
redis-rails (5.0.1)
  redis-actionpack (~> 5.0.0)
  redis-activesupport (~> 5.0.0)
  redis-store (~> 1.2.0)
redis-store (1.2.0)
  redis (>= 2.2)
sass (3.4.23)
sass-rails (5.0.6)
  railties (>= 4.0.0, < 6)
  sass (~> 3.1)
  sprockets (>= 2.8, < 4.0)
  sprockets-rails (>= 2.0, < 4.0)
  tilt (>= 1.1, < 3)
shopify_api (4.3.5)
  activeresource (>= 3.0.0)
  rack
shopify_app (7.2.3)
  omniauth-shopify-oauth2 (~> 1.1.11)
  rails (>= 4.2.6)
  shopify_api (>= 4.2.2)
slop (3.6.0)
spring (2.0.1)
  activesupport (>= 4.2)
sprockets (3.7.1)
  concurrent-ruby (~> 1.0)
  rack (> 1, < 3)
sprockets-rails (3.2.0)
  actionpack (>= 4.0)
  activesupport (>= 4.0)
  sprockets (>= 3.0.0)
sqlite3 (1.3.13)
thor (0.19.4)
thread_safe (0.3.5)
tilt (2.0.6)
turbolinks (5.0.1)
  turbolinks-source (~> 5)
turbolinks-source (5.0.0)
tzinfo (1.2.2)
  thread_safe (~> 0.1)
uglifier (3.0.4)
  execjs (>= 0.3.0, < 3)

PLATFORMS
  ruby

DEPENDENCIES
  httparty
  jbuilder (~> 2.0)
  jquery-rails
  nokogiri
  pry
  puma
  rails (~> 4.2.6)
  redis
  redis-namespace
  redis-rack-cache
  redis-rails
  sass-rails (~> 5.0)
  shopify_api
  shopify_app (~> 7.2)
  spring
  sqlite3
  turbolinks
  uglifier (>= 1.3.0)

  BUNDLED WITH
   1.13.6
Run Code Online (Sandbox Code Playgroud)

Fai*_*ich 6

  • 如果您正在使用运行应用程序,则会发生这种情况foreman.这就是工头处理流程的方式.
  • 一旦你达到断点,在foreman接管之前尽可能快地输入你需要的东西.
  • 不幸的是,你将无法看到你输入的是什么,但只要你输入正确的东西,你应该能够看到输出.

    1. 或者,如果这是我的领班命令 foreman start -f Procfile.dev

    2. 转到foreman正在运行的文件(我的Procfile.dev),并删除运行您的rails服务器的行,对我来说,它类似于 web: rails s -b 0.0.0.0 现在rails s -b 0.0.0.0在不同的终端会话中单独运行.

    3. 您现在应该看到断点后键入的任何内容,并且可以根据需要进行调试.请注意,如果你花费太长时间foreman将接管,你将无法打字.如果是,请重新启动rails服务器.

  • 很高兴知道其他人也在做同样的事情!有点烦人的是没有真正的解决方法。 (3认同)