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

pg_easy_replicate.rb:32:in config': undefined method success?' for nil:NilClass (NoMethodError) #38

Closed
tfmcloughlin opened this issue Jul 31, 2023 · 2 comments · Fixed by #43

Comments

@tfmcloughlin
Copy link
Contributor

tfmcloughlin commented Jul 31, 2023

I'm attempting to get get working on a local macOS build. On my machine the following NoMethodError is raised running when running pg_easy_replicate config_check:

❯ pg_easy_replicate config_check
/usr/local/bin/pg_dump
/Users/thomas.mcloughlinlifelenz.com/.rvm/gems/ruby-3.1.1@apidev/gems/pg_easy_replicate-0.1.8/lib/pg_easy_replicate.rb:32:in `config': undefined method `success?' for nil:NilClass (NoMethodError)

      pg_dump_exists = $CHILD_STATUS.success?
                                    ^^^^^^^^^
        from /Users/thomas.mcloughlinlifelenz.com/.rvm/gems/ruby-3.1.1@apidev/gems/pg_easy_replicate-0.1.8/lib/pg_easy_replicate.rb:65:in `assert_config'
        from /Users/thomas.mcloughlinlifelenz.com/.rvm/gems/ruby-3.1.1@apidev/gems/pg_easy_replicate-0.1.8/lib/pg_easy_replicate/cli.rb:20:in `config_check'
        from /Users/thomas.mcloughlinlifelenz.com/.rvm/gems/ruby-3.1.1@apidev/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
        from /Users/thomas.mcloughlinlifelenz.com/.rvm/gems/ruby-3.1.1@apidev/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/thomas.mcloughlinlifelenz.com/.rvm/gems/ruby-3.1.1@apidev/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
        from /Users/thomas.mcloughlinlifelenz.com/.rvm/gems/ruby-3.1.1@apidev/gems/thor-1.2.2/lib/thor/base.rb:485:in `start'
        from /Users/thomas.mcloughlinlifelenz.com/.rvm/gems/ruby-3.1.1@apidev/gems/pg_easy_replicate-0.1.8/bin/pg_easy_replicate:6:in `<top (required)>'
        from /Users/thomas.mcloughlinlifelenz.com/.rvm/gems/ruby-3.1.1@apidev/bin/pg_easy_replicate:25:in `load'
        from /Users/thomas.mcloughlinlifelenz.com/.rvm/gems/ruby-3.1.1@apidev/bin/pg_easy_replicate:25:in `<main>'
        from /Users/thomas.mcloughlinlifelenz.com/.rvm/gems/ruby-3.1.1@apidev/bin/ruby_executable_hooks:22:in `eval'
        from /Users/thomas.mcloughlinlifelenz.com/.rvm/gems/ruby-3.1.1@apidev/bin/ruby_executable_hooks:22:in `<main>'❯ pg_easy_replicate config_check
/usr/local/bin/pg_dump
/Users/thomas.mcloughlinlifelenz.com/.rvm/gems/ruby-3.1.1@apidev/gems/pg_easy_replicate-0.1.8/lib/pg_easy_replicate.rb:32:in `config': undefined method `success?' for nil:NilClass (NoMethodError)

It seems lib/pg_easy_replicate is using the global variable $CHILD_STATUS which is not defined in my environment.

Adding require 'english' manually near the top of lib/pg_easy_replicate.rb to the fixes the issue:

❯ pg_easy_replicate config_check
/usr/local/bin/pg_dump
✅ Config is looking good.

I'm using:
pg_easy_replicate version: 0.1.8
ruby version: ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-darwin22]

@shayonj
Copy link
Owner

shayonj commented Jul 31, 2023

Thanks! nice find. I will take a look at this today/tomorrow latest.

@shayonj
Copy link
Owner

shayonj commented Aug 2, 2023

0.1.9 is out now, thanks for the report.

https://github.com/shayonj/pg_easy_replicate/releases/tag/v0.1.9

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

Successfully merging a pull request may close this issue.

2 participants