我是Rails的新手,我刚刚开始遇到麻烦。我一直得到一个错误,因为分配问题导致fork失败。这是代码:
root@shotgunrides:/home/rails/rails_project# rails g model post email:string
/usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.6.2/lib/spring/application.rb:156:in `fork': Cannot allocate memory - fork(2) (Errno::ENOMEM)
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.6.2/lib/spring/application.rb:156:in `serve'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.6.2/lib/spring/application.rb:131:in `block in run'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.6.2/lib/spring/application.rb:125:in `loop'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.6.2/lib/spring/application.rb:125:in `run'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.6.2/lib/spring/application/boot.rb:18:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
答案 0 :(得分:1)
通常,当您看到ENOMEM
时,这意味着您的系统没有足够的可用内存来完成您尝试的任何操作。在这种情况下,您的系统看起来没有足够的内存来处理您的rails
命令,只是爆炸。
如果您可以发布一些有用的系统规范,但杀死正在运行的进程几乎就是解决方案(除了添加更多RAM)。