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

Fails when $TERM=xterm #159

Open
alphabt opened this issue Mar 27, 2019 · 4 comments
Open

Fails when $TERM=xterm #159

alphabt opened this issue Mar 27, 2019 · 4 comments

Comments

@alphabt
Copy link

alphabt commented Mar 27, 2019

I have a rails app that uses rb-readline. When I rails console in Alpine Linux it fails with error below.

/usr/src/app $ rails c
Loading production environment (Rails 5.2.2.1)
/usr/src/app/bin/rails: No such file or directory - infocmp
Traceback (most recent call last):
	43: from /usr/src/app/bin/rails:9:in `<main>'
	42: from /usr/local/bundle/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
	41: from /usr/local/bundle/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:257:in `load_dependency'
	40: from /usr/local/bundle/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `block in require'
	39: from /usr/local/bundle/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
	38: from /usr/local/bundle/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
	37: from /usr/local/bundle/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
	36: from /usr/local/bundle/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
	35: from /usr/local/bundle/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
	34: from /usr/local/bundle/gems/railties-5.2.2.1/lib/rails/commands.rb:18:in `<main>'
	33: from /usr/local/bundle/gems/railties-5.2.2.1/lib/rails/command.rb:46:in `invoke'
	32: from /usr/local/bundle/gems/railties-5.2.2.1/lib/rails/command/base.rb:65:in `perform'
	31: from /usr/local/bundle/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	30: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	29: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	28: from /usr/local/bundle/gems/railties-5.2.2.1/lib/rails/commands/console/console_command.rb:96:in `perform'
	27: from /usr/local/bundle/gems/railties-5.2.2.1/lib/rails/commands/console/console_command.rb:19:in `start'
	26: from /usr/local/bundle/gems/railties-5.2.2.1/lib/rails/commands/console/console_command.rb:64:in `start'
	25: from /usr/local/lib/ruby/2.6.0/irb.rb:383:in `start'
	24: from /usr/local/lib/ruby/2.6.0/irb.rb:427:in `run'
	23: from /usr/local/lib/ruby/2.6.0/irb.rb:427:in `catch'
	22: from /usr/local/lib/ruby/2.6.0/irb.rb:428:in `block in run'
	21: from /usr/local/lib/ruby/2.6.0/irb.rb:489:in `eval_input'
	20: from /usr/local/lib/ruby/2.6.0/irb/ruby-lex.rb:231:in `each_top_level_statement'
	19: from /usr/local/lib/ruby/2.6.0/irb/ruby-lex.rb:231:in `catch'
	18: from /usr/local/lib/ruby/2.6.0/irb/ruby-lex.rb:232:in `block in each_top_level_statement'
	17: from /usr/local/lib/ruby/2.6.0/irb/ruby-lex.rb:232:in `loop'
	16: from /usr/local/lib/ruby/2.6.0/irb/ruby-lex.rb:236:in `block (2 levels) in each_top_level_statement'
	15: from /usr/local/lib/ruby/2.6.0/irb/ruby-lex.rb:266:in `lex'
	14: from /usr/local/lib/ruby/2.6.0/irb/ruby-lex.rb:292:in `token'
	13: from /usr/local/lib/ruby/2.6.0/irb/slex.rb:76:in `match'
	12: from /usr/local/lib/ruby/2.6.0/irb/slex.rb:206:in `match_io'
	11: from /usr/local/lib/ruby/2.6.0/irb/ruby-lex.rb:104:in `getc'
	10: from /usr/local/lib/ruby/2.6.0/irb/ruby-lex.rb:189:in `buf_input'
	 9: from /usr/local/lib/ruby/2.6.0/irb.rb:472:in `block in eval_input'
	 8: from /usr/local/lib/ruby/2.6.0/irb.rb:647:in `signal_status'
	 7: from /usr/local/lib/ruby/2.6.0/irb.rb:473:in `block (2 levels) in eval_input'
	 6: from /usr/local/lib/ruby/2.6.0/irb/input-method.rb:151:in `gets'
	 5: from /usr/local/bundle/gems/rb-readline-0.5.5/lib/readline.rb:45:in `readline'
	 4: from /usr/local/bundle/gems/rb-readline-0.5.5/lib/rbreadline.rb:4868:in `readline'
	 3: from /usr/local/bundle/gems/rb-readline-0.5.5/lib/rbreadline.rb:3849:in `rl_initialize'
	 2: from /usr/local/bundle/gems/rb-readline-0.5.5/lib/rbreadline.rb:2564:in `readline_initialize_everything'
	 1: from /usr/local/bundle/gems/rb-readline-0.5.5/lib/rbreadline.rb:2027:in `_rl_init_terminal_io'
/usr/local/bundle/gems/rb-readline-0.5.5/lib/rbreadline.rb:1815:in `get_term_capabilities': undefined method `split' for nil:NilClass (NoMethodError)

It works if I do TERM=dumb rails console.

Environment

$ cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.9.2
PRETTY_NAME="Alpine Linux v3.9"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
$ echo $TERM
xterm
@RORingBBK
Copy link

@alphabt Did you get workaround for this?

@alphabt
Copy link
Author

alphabt commented Jul 31, 2019

@RORingBBK unfortunately not, the only workaround is run TERM=dumb rails console. I've since removed this gem so I am no longer bumping into this issue.

@Spakman
Copy link
Collaborator

Spakman commented Aug 3, 2019

Looks like you don't have infocmp available on your system. We currently use that to detect terminal capabilities. Ideally I'd love us to get rid of all the places that we need to shell out, but I think realistically it might be better just to document them all as requirements for now.

@EnziinSystem
Copy link

EnziinSystem commented Jan 28, 2020

I solved it with add the ncurses package.

apk add ncurses

It's worked

bash-5.0# rails console
Running via Spring preloader in process 49
Loading development environment (Rails 5.2.4.1)
irb(main):001:0>

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

4 participants