简体   繁体   English

使用bundle exec运行rails控制台

[英]Running rails console with bundle exec

When I execute bundle exec rails c I get a ruby console with the following prompt 当我执行bundle exec rails c我得到一个带有以下提示的ruby控制台

Loading development environment (Rails 3.0.3)
jruby-1.6.3 :001 >

Everything looks in order but when I use the ↑ ↓ arrows to pull my previous command I get ^[[A^[[B output into my console. 一切都看起来有序,但当我使用↑↓箭头拉我的上一个命令时,我得^[[A^[[B输出到我的控制台。

Running rails console without bundle exec works fine. 没有bundle exec运行rails控制台工作正常。 Any reason as to why this is? 有什么理由说明这是为什么? Is bundle exec starting up some new faux shell? bundle exec是否会启动一些新的人造壳?

It looks like bundler prevents the irb console from using readline. 它看起来像bundler阻止irb控制台使用readline。 You can work around this by putting the following line in your .irbrc , which will force irb to use readline: 您可以通过在.irbrc以下行来解决此.irbrc ,这将迫使irb使用readline:

IRB.conf[:USE_READLINE] = true

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM