我注意到 ruby 进程(60 个!)在我的服务器上吃掉了 ram……我看到它们中的大多数是我不想要的 spring 进程。看到这个:
$ ps aux | grep spring
david 30704 0.0 0.0 7832 836 pts/4 S+ 21:02 0:00 grep spring
$ rails c -e production
Loading production environment (Rails 4.1.6)
irb(main):001:0> exit
$ ps aux | grep spring
david 30798 6.1 0.6 156640 25976 pts/4 Sl 21:02 0:00 spring server | 49 | started 5 secs ago
david 30802 46.4 2.6 256888 108364 ? Ssl 21:02 0:02 spring app | 49 | started 5 secs ago | development mode
david 30814 0.0 0.0 7832 836 pts/4 S+ 21:02 0:00 grep spring
$ cat Gemfile | grep spring -C 5
group :development do
gem 'better_errors'
gem 'meta_request'
gem 'awesome_print'
gem 'binding_of_caller'
gem 'spring'
end
gem 'twilio-ruby'
gem "highcharts-rails", "~> 4.0.0"
gem 'whenever'
$
那么它们为什么会出现呢?如果我gem 'spring'
完全从 Gemfile 中删除,这将停止......那么如果 gem 在开发组中,为什么 Rails 会在生产控制台中启动 spring 服务器?