问题描述
当我执行时,我得到一个红宝石控制台,并显示以下提示
When I execute bundle exec rails c I get a ruby console with the following prompt
Loading development environment (Rails 3.0.3) jruby-1.6.3 :001 >
一切看起来都很正常,但是当我使用↑↓箭头拉出我之前的命令时,我得到 ^ [[A ^ [[B 输出到我的控制台。
Everything looks in order but when I use the ↑ ↓ arrows to pull my previous command I get ^[[A^[[B output into my console.
没有bundle exec的运行rails控制台工作正常。有什么原因呢?捆绑包执行程序是否正在启动一些新的人造shell?
Running rails console without bundle exec works fine. Any reason as to why this is? Is bundle exec starting up some new faux shell?
推荐答案
看起来捆绑程序阻止irb控制台使用readline。您可以通过在 .irbrc 中放置以下行来解决此问题,这将迫使irb使用readline:
It looks like bundler prevents the irb console from using readline. You can work around this by putting the following line in your .irbrc, which will force irb to use readline:
IRB.conf[:USE_READLINE] = true
这篇关于使用bundle exec运行Rails控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!