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

LoadError in Airbrussh::Console#utf8_supported? #90

Open
mike-stewart opened this issue Jul 27, 2016 · 2 comments
Open

LoadError in Airbrussh::Console#utf8_supported? #90

mike-stewart opened this issue Jul 27, 2016 · 2 comments
Labels

Comments

@mike-stewart
Copy link

mike-stewart commented Jul 27, 2016

Using airbrussh 1.1.0 (w/ capistrano 3.6.0 and ruby 2.1.7), I intermittently get a LoadError printing certain non-ASCII text. Sometimes it prints OK, sometimes it blows up.

This is the backtrace for a string containing the Unicode character "𝄞" (U+1D11E):

LoadError: dlopen(enc/trans/single_byte.so, 9): image not found - enc/trans/single_byte.so
gems/airbrussh-1.1.0/lib/airbrussh/console.rb:83:in `encode'
gems/airbrussh-1.1.0/lib/airbrussh/console.rb:83:in `utf8_supported?'
gems/airbrussh-1.1.0/lib/airbrussh/console.rb:42:in `truncate_to_console_width'
gems/airbrussh-1.1.0/lib/airbrussh/console.rb:26:in `print_line'
gems/airbrussh-1.1.0/lib/airbrussh/console_formatter.rb:112:in `print_line'
gems/airbrussh-1.1.0/lib/airbrussh/console_formatter.rb:117:in `print_indented_line'
gems/airbrussh-1.1.0/lib/airbrussh/console_formatter.rb:42:in `block in log_command_data'
gems/airbrussh-1.1.0/lib/airbrussh/console_formatter.rb:41:in `each_line'
gems/airbrussh-1.1.0/lib/airbrussh/console_formatter.rb:41:in `log_command_data'
gems/airbrussh-1.1.0/lib/airbrussh/delegating_formatter.rb:25:in `public_send'
gems/airbrussh-1.1.0/lib/airbrussh/delegating_formatter.rb:25:in `block (3 levels) in <class:DelegatingFormatter>'
gems/airbrussh-1.1.0/lib/airbrussh/delegating_formatter.rb:25:in `map'
gems/airbrussh-1.1.0/lib/airbrussh/delegating_formatter.rb:25:in `block (2 levels) in <class:DelegatingFormatter>'

I fixed it by also rescueing LoadError here: https://github.com/mattbrictson/airbrussh/blob/master/lib/airbrussh/console.rb#L84

Any ideas on what could be going wrong here, or would you be open to a PR to add a rescue @mattbrictson?

@mattbrictson
Copy link
Owner

Thanks for the report!

My hunch is that this is a problem with your Ruby installation. I'd rather not add a rescue unless this problem is widespread. Can you see if there is a fix for your Ruby?

I found this, maybe it will help: http://stackoverflow.com/questions/13277729/ruby-loaderror-enc-trans-single-byte

@mike-stewart
Copy link
Author

I looked at that earlier and tried the suggested solution of ensuring everything in ~/.rvm (I use RVM on OS X) was readable by my user. Also tried reinstalling my ruby. No dice.

I'll dig in some more and post here if I can find a solution.

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

No branches or pull requests

2 participants