webrick rails 服务器在启动几秒后关闭

webrick rails server shuts down a few seconds after starting

几天后根本无法 运行 WEBrick rails 服务器,我终于启动了它,运行ning 只在它关闭后大约 5 秒已经开始了。

这是一个通过命令行创建的全新项目。我所做的唯一更改是在 gem 文件中,我在其中注释掉了很多 gem,在我这样做之前服务器甚至不会 运行。现在它将 运行 几秒钟然后关闭。

我习惯在 mac 上使用 rails 并且从未遇到过这个问题,但最近转换到 windows 并且我很难确定确切的问题。

如果大家对我如何解决这个问题有任何想法或建议,我将不胜感激

这是一个屏幕截图:

谢谢

彼得

你是如何安装 ruby / rails 的?

如果您使用 rubyinstaller.org 中的 ruby 安装程序,您可以尝试使用版本 2.1.X(我看到您现在正在使用 2.2.X) ,因为这些似乎已经稳定了:

If you don’t know what version to install and you’re getting started with Ruby, we recommend you use Ruby 2.1.X installers. These provide a stable language and a extensive list of packages (gems) that are compatible and updated.

你还应该考虑使用 32 位版本,因为他们说 64 位对 windows 来说是相当新的:

The 64-bit versions of Ruby are relatively new on the Windows area and not all the packages have been updated to be compatible with it. To use this version you will require some knowledge about compilers and solving dependency issues, which might be too complicated if you just want to play with the language.


如果您查看 railsinstaller.org,他们也在使用 ruby 2.1.5 作为最新的 windows 安装程序包。