Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pasting a long string of text into Heroku rails console

Pasting any string longer than a couple hundred characters into a Heroku rails console takes forever. The more characters are pasted, the slower it goes, letter by letter. Is there a way to make this run at a reasonable speed?

like image 707
Aaron Gray Avatar asked Oct 27 '20 15:10

Aaron Gray


2 Answers

Run this in project directory

heroku run 'bundle exec rails c -- --nomultiline'
like image 58
PGill Avatar answered Nov 16 '22 11:11

PGill


This is a problem with Ruby's 2.7's default multi-line pasting in irb. Here's how to resolve it.

$ heroku run -a my_app_name bash
$ echo 'IRB.conf[:USE_MULTILINE] = false' > ~/.irbrc
$ bin/rails c
> <Now you can paste the text in and it will go quickly>
like image 35
Aaron Gray Avatar answered Nov 16 '22 10:11

Aaron Gray