rails console fails with `Switch to inspect mode` in windows

不问归期 提交于 2019-12-22 03:30:34

问题


I create a rails project by rails new foo, then cd foo, and run rails c.

Then I got message like this.

DL is deprecated, please use Fiddle
Loading development environment (Rails 4.0.2)
Switch to inspect mode.

That's all. I can't use rails console.

Have you any idea what am I doing wrong?

I'm using railsinstaller with ruby 1.9.3 and 2.0.0 both, and ruby 2.0.0p451 (2014-02-24) [i386-mingw32] from Rubyinstaller. All versions fails with same error.

There is no problem with simple irb command.

Edit

By following Graeme's advice, I updated rb-readline from 0.5.0 to 0.5.1. and uninstalled old one.

$ gem list | grep rb-readline
rb-readline (0.5.1)

But the message remains same.


回答1:


In case anyone gets this error with Docker, I got it because I ran docker run rails but needed -it.

> docker run rails
Switch to inspect mode. # fail
> docker run -it rails
irb(main):001:0> # yay



回答2:


This is a known problem caused by the rb-readline gem in version 0.5.0. It has been subsequently fixed in 0.5.1 which came out a few months ago.

You should therefore upgrade the rb-readline gem to v0.5.1 to fix this problem.

You can see here more details about the issue and the resolution.



来源:https://stackoverflow.com/questions/23578440/rails-console-fails-with-switch-to-inspect-mode-in-windows

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