JEG2 / highline

A higher level command-line oriented interface.
Other
1.29k stars 137 forks source link

undefined local variable on Solaris #155

Closed dhduvall closed 9 years ago

dhduvall commented 9 years ago

Trying to run bosh:

.../gems/highline-1.6.21/lib/highline/system_extensions.rb:228:in `block in terminal_size': undefined local variable or method `x' for HighLine::SystemExtensions:Module (NameError)
    from .../gems/highline-1.6.21/lib/highline/system_extensions.rb:228:in `map'
    from .../gems/highline-1.6.21/lib/highline/system_extensions.rb:228:in `terminal_size'
    from .../gems/bosh_cli-1.3072.0/lib/cli/core_ext.rb:108:in `terminal_width'
    from .../gems/bosh_cli-1.3072.0/lib/cli/commands/help.rb:63:in `list_commands'
    from .../gems/bosh_cli-1.3072.0/lib/cli/commands/help.rb:59:in `keyword_help'
    from .../gems/bosh_cli-1.3072.0/lib/cli/commands/help.rb:17:in `help'
    from .../gems/bosh_cli-1.3072.0/lib/cli/command_handler.rb:57:in `run'
    from .../gems/bosh_cli-1.3072.0/lib/cli/runner.rb:56:in `run'
    from .../gems/bosh_cli-1.3072.0/bin/bosh:19:in `<top (required)>'
    from ./bin/bosh:23:in `load'
    from ./bin/bosh:23:in `<main>'

It's pretty clear that there's a mismatch in the variable names in the code:

[$2, $1].map { |c| x.to_i }

where either c needs to be x or vice versa. The code has since moved into terminal/unix_stty.rb, but is otherwise unchanged.

abinoam commented 9 years ago

Hi @dhduvall,

Thank you very much for reporting the issue. We'll be shipping a fix soon.

But... I see that you're running an old version of HighLine (1.6.21) We're not maintaining the 1.6.x We're bug fixing 1.7.x and developing 2.0.x. I would suggest you to upgrade to 1.7 stable branch.

abinoam commented 9 years ago

Dear @dhduvall ,

We have released a new version with your reported issue fixed. Could you test it and confirm if there's any other issue on solaris?

dhduvall commented 9 years ago

So bosh_cli's gemspec claims a dependency on highline ~> 1.6.2 for reasons I haven't dug into, but if I modify that, the latest git repo at least gets past the error.

Thanks!