gpt4 book ai didi

ruby - pry 动错误警告 : already initialized constant previous definition of DEFAULT_HOOKS was here

转载 作者:太空宇宙 更新时间:2023-11-03 17:15:38 26 4
gpt4 key购买 nike

我整年都在终端中使用 pry,没有任何问题。但是从昨晚开始,每次我在终端中输入 pry 时,它都打不开,而是给我一长串错误日志。我尝试了几件事并花了很多时间进行搜索,但我迷路了,不知道下一步该怎么做。我不明白为什么它会给我一些带有不同错误的 ruby​​ 文件的行号,因为它通常可以在与文件无关的情况下工作。日志有点长,但错误不断重复。我把一切都放在以防万一它很重要。我非常感谢一些指导。

Last login: Wed Jul 23 10:35:32 on console
You have mail.
Sylvies-MacBook-Air:~ sylviecottrell$ pry
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:14: warning: already initialized constant Pry::DEFAULT_HOOKS
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:14: warning: previous definition of DEFAULT_HOOKS was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:20: warning: already initialized constant Pry::DEFAULT_PRINT
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:20: warning: previous definition of DEFAULT_PRINT was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:29: warning: already initialized constant Pry::SIMPLE_PRINT
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:29: warning: previous definition of SIMPLE_PRINT was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:38: warning: already initialized constant Pry::CLIPPED_PRINT
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:38: warning: previous definition of CLIPPED_PRINT was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:43: warning: already initialized constant Pry::DEFAULT_EXCEPTION_HANDLER
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:43: warning: previous definition of DEFAULT_EXCEPTION_HANDLER was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:52: warning: already initialized constant Pry::DEFAULT_PROMPT_NAME
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:52: warning: previous definition of DEFAULT_PROMPT_NAME was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:55: warning: already initialized constant Pry::DEFAULT_PROMPT
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:55: warning: previous definition of DEFAULT_PROMPT was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:65: warning: already initialized constant Pry::DEFAULT_PROMPT_SAFE_OBJECTS
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:65: warning: previous definition of DEFAULT_PROMPT_SAFE_OBJECTS was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:68: warning: already initialized constant Pry::SIMPLE_PROMPT
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:68: warning: previous definition of SIMPLE_PROMPT was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:70: warning: already initialized constant Pry::NO_PROMPT
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:70: warning: previous definition of NO_PROMPT was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:72: warning: already initialized constant Pry::SHELL_PROMPT
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:72: warning: previous definition of SHELL_PROMPT was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:79: warning: already initialized constant Pry::NAV_PROMPT
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:79: warning: previous definition of NAV_PROMPT was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:94: warning: already initialized constant Pry::DEFAULT_CONTROL_D_HANDLER
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:94: warning: previous definition of DEFAULT_CONTROL_D_HANDLER was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:109: warning: already initialized constant Pry::DEFAULT_SYSTEM
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:109: warning: previous definition of DEFAULT_SYSTEM was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:117: warning: already initialized constant Pry::INITIAL_PWD
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:117: warning: previous definition of INITIAL_PWD was here
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry/cli.rb:6: warning: already initialized constant Pry::CLI::NoOptionsError
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry/cli.rb:6: warning: previous definition of NoOptionsError was here
/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1998:in `raise_if_conflicts': Unable to activate pry-byebug-1.3.2, because pry-0.10.0 conflicts with pry (~> 0.9.12) (Gem::LoadError)
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1235:in `activate'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems.rb:194:in `rescue in try_activate'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems.rb:191:in `try_activate'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-byebug-1.3.2/lib/pry-byebug/cli.rb:1:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry/plugins.rb:38:in `load_cli_options'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry/cli.rb:40:in `block in add_plugin_options'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry/cli.rb:39:in `each'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry/cli.rb:39:in `add_plugin_options'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry/cli.rb:107:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/lib/pry.rb:150:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/bin/pry:12:in `rescue in <top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/pry-0.10.0/bin/pry:8:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p353/bin/pry:23:in `load'
from /usr/local/rvm/gems/ruby-2.0.0-p353/bin/pry:23:in `<main>'
from /usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'
Sylvies-MacBook-Air:~ sylviec

最佳答案

Pry 最近从版本 9.12 升级到版本 10,似乎更新与 bye-bug 或 pry-nav 不兼容......两者之一。我已经通过恢复到 Pry 9.12 版解决了这个问题。您可以通过键入...

gem uninstall pry

它会询问您要卸载哪个版本,您需要卸载版本“10”。如果它不询问您并且您完全卸载 Pry,您可以通过...将其取回。

gem install pry -v 0.9.12

希望这对您有所帮助。

关于ruby - pry 动错误警告 : already initialized constant previous definition of DEFAULT_HOOKS was here,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24917565/

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