Skip to content

Instantly share code, notes, and snippets.

@atton
Last active January 4, 2016 19:53
Show Gist options
  • Save atton/5facfe29cf251ef9323f to your computer and use it in GitHub Desktop.
Save atton/5facfe29cf251ef9323f to your computer and use it in GitHub Desktop.
crash logs pry-rails saved multibyte characters into history with rb-readline
Pry.history.instance_eval do
@saver = ->(line) { save_to_file (line.force_encoding(STDIN.external_encoding))}
end
source 'https://rubygems.org'
ruby '2.2.1'
gem 'rails', '4.2.0'
gem 'rb-readline', '0.5.2'
gem 'pry', '0.10.1'
gem 'pry-rails', '0.3.3'
gem 'sqlite3' # for bundle install
[1] pry(main)> ������������������������������������������
/Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/history.rb:106:in `write': "\xE3" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/history.rb:106:in `puts'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/history.rb:106:in `save_to_file'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/history.rb:50:in `call'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/history.rb:50:in `push'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/pry_instance.rb:267:in `handle_line'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/pry_instance.rb:243:in `block (2 levels) in eval'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/pry_instance.rb:242:in `catch'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/pry_instance.rb:242:in `block in eval'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/pry_instance.rb:241:in `catch'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/pry_instance.rb:241:in `eval'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/repl.rb:77:in `block in repl'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/repl.rb:67:in `loop'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/repl.rb:67:in `repl'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/repl.rb:38:in `block in start'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/input_lock.rb:61:in `call'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/input_lock.rb:61:in `__with_ownership'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/input_lock.rb:79:in `with_ownership'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/repl.rb:38:in `start'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/repl.rb:15:in `start'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/pry_class.rb:169:in `start'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/console.rb:110:in `start'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/console.rb:9:in `start'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:68:in `console'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/atton/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:8:in `require'
from bin/rails:8:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment