撬警告错误:警告:已初始化DEFAULT_HOOKS的常量先前的定义在此处 [英] error with pry- warning: already initialized constant previous definition of DEFAULT_HOOKS was here

查看:71
本文介绍了撬警告错误:警告:已初始化DEFAULT_HOOKS的常量先前的定义在此处的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一年四季都在终端中使用撬撬,没有任何问题.但是从昨晚开始,每当我在终端中键入pry时,它都不会打开,而是给了我很长的错误日志. 我尝试了几件事,花了很多时间进行搜索,但是我迷失了方向,不知道下一步该怎么做. 我不明白为什么它会给我一些红宝石文件的行号带来不同的错误,因为它通常可以正常工作而与文件无关. 日志有点长,但是错误会重复出现.我把一切都放在重要的位置. 我非常感谢您提供一些指导.

I have used pry in the terminal all year long without any problem. But starting last night, every time I type pry in the terminal, it doesn't open and instead gives me a long log of errors. I tried several things and spent a lot of time searching but I am at lost and don't know what to do next. I don't understand why it gives me some line numbers of a ruby file with the different errors since it usually work without being related to a file. The log is a bit long, but the errors get repeated. I put everything in case it was important. I would very much appreciate some guidance.

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来解决此问题.您可以输入...

Pry went from version 9.12 to version 10 recently, and it seems the update created an incompatibility with bye-bug or pry-nav... One of the two. I've gotten around this by reverting back to Pry version 9.12. You can do this by typing...

gem uninstall pry

它将询问您要卸载哪个版本,您要卸载版本"10".如果它不询问您,并且您完全卸载了Pry,则可以通过...直接恢复它.

It'll ask you which version to uninstall, you'll want to uninstall version '10.' If it doesn't ask you and you uninstall Pry entirely, you can get it right back with...

gem install pry -v 0.9.12

希望这会有所帮助.

这篇关于撬警告错误:警告:已初始化DEFAULT_HOOKS的常量先前的定义在此处的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆