Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using pry 0.13.0 results in the error NoMethodError: undefined method `theme_options' for #<Pry::Config:0x000055dbe462bdd8> #59

Closed
yorickpeterse opened this issue Apr 1, 2020 · 4 comments

Comments

@yorickpeterse
Copy link

yorickpeterse commented Apr 1, 2020

Full error:

when_started hook failed: NoMethodError: undefined method `theme_options' for #<Pry::Config:0x000055dbe462bdd8>
/home/yorickpeterse/.gem/ruby/2.7.1/gems/pry-0.13.0/lib/pry/config.rb:250:in `method_missing'
(see pry_instance.hooks.errors to debug)
2.7.1p83 > error = pry_instance.hooks.errors.first
=> #<NoMethodError: undefined method `theme_options' for #<Pry::Config:0x000055dbe462bdd8>>
2.7.1p83 > puts error.backtrace
/home/yorickpeterse/.gem/ruby/2.7.1/gems/pry-0.13.0/lib/pry/config.rb:250:in `method_missing'
/home/yorickpeterse/.gem/ruby/2.7.1/gems/pry-theme-1.3.0/lib/pry-theme/when_started_hook.rb:22:in `apply_config'
/home/yorickpeterse/.gem/ruby/2.7.1/gems/pry-theme-1.3.0/lib/pry-theme/when_started_hook.rb:16:in `call'
/home/yorickpeterse/.gem/ruby/2.7.1/gems/pry-0.13.0/lib/pry/hooks.rb:111:in `block in exec_hook'
/home/yorickpeterse/.gem/ruby/2.7.1/gems/pry-0.13.0/lib/pry/hooks.rb:109:in `map'
/home/yorickpeterse/.gem/ruby/2.7.1/gems/pry-0.13.0/lib/pry/hooks.rb:109:in `exec_hook'
/home/yorickpeterse/.gem/ruby/2.7.1/gems/pry-0.13.0/lib/pry/pry_instance.rb:396:in `exec_hook'
/home/yorickpeterse/.gem/ruby/2.7.1/gems/pry-0.13.0/lib/pry/pry_instance.rb:95:in `initialize'
/home/yorickpeterse/.gem/ruby/2.7.1/gems/pry-0.13.0/lib/pry/repl.rb:15:in `new'
/home/yorickpeterse/.gem/ruby/2.7.1/gems/pry-0.13.0/lib/pry/repl.rb:15:in `start'
/home/yorickpeterse/.gem/ruby/2.7.1/gems/pry-0.13.0/lib/pry/pry_class.rb:191:in `start'
/home/yorickpeterse/.gem/ruby/2.7.1/gems/pry-0.13.0/lib/pry/cli.rb:119:in `start'
/home/yorickpeterse/.gem/ruby/2.7.1/gems/pry-0.13.0/bin/pry:13:in `<top (required)>'
/home/yorickpeterse/.gem/ruby/2.7.1/bin/pry:23:in `load'
/home/yorickpeterse/.gem/ruby/2.7.1/bin/pry:23:in `<main>'

This is using the following config:

Pry.config.theme = 'happy_hacking'

Pry.config.prompt = Pry::Prompt.new(
  'custom',
  'Custom Pry prompt',
  [
  # Regular prompt.
  proc do |obj, nest_level, _|
    "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL} > "
  end,
  # Wait prompt
  proc do |obj, nest_level, _|
    "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL} * "
  end
  ]
)
@kyrylo
Copy link
Owner

kyrylo commented Apr 2, 2020

Wow, you still use this gem 😄
I'll look into that.

@yorickpeterse
Copy link
Author

@kyrylo As long as the default colors of Pry remaing somewhat unpleasant, I will keep using this Gem 😄

kyrylo added a commit to pry/pry that referenced this issue Apr 12, 2020
Returning `nil` on unknown option was default behaviour for Pry v0.12.x. In
e5556a2 I changed that but I am not sure if it
was intentional. This breaks plugins such as
pry-theme (kyrylo/pry-theme#59).

Returning `nil` makes more sense, because we can write code like this:

```
Pry.config.foo ||= 123
```

...whereas as of now this is no longer possible and you would need to use
`respond_to?` to achieve the same effect.
kyrylo added a commit to pry/pry that referenced this issue Apr 12, 2020
Returning `nil` on unknown option was default behaviour for Pry v0.12.x. In
e5556a2 I changed that but I am not sure if it
was intentional. This breaks plugins such as
pry-theme (kyrylo/pry-theme#59).

Returning `nil` makes more sense, because we can write code like this:

```
Pry.config.foo ||= 123
```

...whereas as of now this is no longer possible and you would need to use
`respond_to?` to achieve the same effect.
@kyrylo
Copy link
Owner

kyrylo commented Apr 12, 2020

Fixed by pry/pry#2126 in Pry and released in Pry v0.13.1.
Please update: https://rubygems.org/gems/pry/versions/0.13.1

@kyrylo kyrylo closed this as completed Apr 12, 2020
@yorickpeterse
Copy link
Author

@kyrylo Thanks! 🎆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants