将一长串文本粘贴到 Heroku rails 控制台

Pasting a long string of text into Heroku rails console

将任何超过几百个字符的字符串粘贴到 Heroku rails 控制台中需要很长时间。粘贴的字符越多,逐个字母的速度就越慢。有没有办法让这个 运行 以合理的速度?

这是a problem with Ruby's 2.7's default multi-line pasting in irb。下面是解决方法。

$ 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>

运行 这个在项目目录下

heroku run 'bundle exec rails c -- --nomultiline'