Rails console runs without prompt

北战南征 提交于 2019-12-18 08:15:42

问题


When I run my rails console I got something like this:

Loading development environment (Rails 3.2.3)
/Users/sebastiannowak/.rvm/gems/jruby-1.6.7@global/gems/bundler-1.1.0/lib/bundler.rb:254 warning: shadowing outer local variable - path
Switch to inspect mode.
Time.now
Time.now
2012-06-27 09:27:21 +0200

As you can see I can interact with console but it is quite uncomfortable. I run JRuby 1.6.7. Somebody has such issue?


回答1:


Most probably somewhere in you ~/.irbrc, you're doing:

IRB.conf[:PROMPT_MODE] = :XMP

Try removing that line. Or change it to:

IRB.conf[:PROMPT_MODE] = :SIMPLE



回答2:


On newer version of JRuby, the Rails console has a variety of other problems for me as well:

  • Command duplicated on the next line
  • Multiple Enter keypresses needed to exit
  • First command doesn't show while typing

Running the console with the following fixed it for me:

jruby -Xlaunch.inproc=true -S rails c


来源:https://stackoverflow.com/questions/11221345/rails-console-runs-without-prompt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!