You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IO.console could be also nil if Ruby executable is called through a sudo su - user -c '~/.rvm/bin/rvm 2.3.1 do ruby -e -e "require %{io/console}; puts IO.console.winsize"' construction. It should be nil-checked anyway.
(To be honest in this case @output.tty? either should not be true (indicating the output is not a tty) or IO.console should be a valid TTY console, so this is a bug in MRI Ruby anyway, but should be workarounded as Ruby development and upgrading shipped versions in Linux distributions is much slower than any Gem development)
Example outputs:
$ sudo su - app -c 'cd /deploy/ && /home/app/.rvm/bin/rvm ruby-2.3.1@default do ruby -e "require %{io/console}; puts IO.console.winsize"'
-e:1:in `<main>': undefined method `winsize' for nil:NilClass (NoMethodError)
$ /home/app/.rvm/bin/rvm ruby-2.3.1@default do ruby -e "require %{io/console}; puts IO.console.winsize"
55
211
$
My hack was adding and IO.console to the end of this line, but I am not sure it should be a right fix. It just provided me a working Capistrano run and I wasn't interested more in the solution.
The text was updated successfully, but these errors were encountered:
IO.console
could be also nil if Ruby executable is called through asudo su - user -c '~/.rvm/bin/rvm 2.3.1 do ruby -e -e "require %{io/console}; puts IO.console.winsize"'
construction. It should be nil-checked anyway.(To be honest in this case
@output.tty?
either should not be true (indicating the output is not a tty) orIO.console
should be a valid TTY console, so this is a bug in MRI Ruby anyway, but should be workarounded as Ruby development and upgrading shipped versions in Linux distributions is much slower than any Gem development)Example outputs:
My hack was adding
and IO.console
to the end of this line, but I am not sure it should be a right fix. It just provided me a working Capistrano run and I wasn't interested more in the solution.The text was updated successfully, but these errors were encountered: