Ruby on Rails - rails server exits immediately after starting (SystemStackError)

半世苍凉 提交于 2019-12-08 18:23:27

In Ruby 2.3.x or earlier, there's a base class Integer which you don't instantiate or address directly. Instead, you address the supposed-fast Fixnum with limited precision or the supposed-slower Bignum which can handle very large numbers.

In Ruby 2.4.0, the maintainers made the genuinely astonishing decision to 'deprecate' Fixnum and Bignum, rolling them both into Integer. Any code using Fixnum or Bignum will get a warning. Any tests or other code introspecting on for example the class of 42 will get the answer Integer instead of Fixnum.

This is a very, very difficult change to handle in real world code (e.g. a gem) that wants to run on both Ruby 2.3.x or earlier, or 2.4.0 or later.

Rails 4.2 predates Ruby 2.4 and I don't know if it is fully compatible. My guess is that downgrading your system's Ruby to 2.3.3 will clear your issues. It'll certainly get rid of all the warnings polluting your console and, if the crash still happens, give a better chance of seeing a relevant message giving away the root cause.

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