# Rails console using 100% CPU in dev (fix)

**URL:** <https://forum.devtalk.com/t/rails-console-using-100-cpu-in-dev-fix/6633>\
**Category:** Backend Chat/Discussions\
**Tags:** ruby, rails\
**Created:** [3 February 2021 06:15 UTC](https://forum.devtalk.com/t/rails-console-using-100-cpu-in-dev-fix/6633 "2021-02-03T06:15:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AstonJ](https://forum.devtalk.com/user_avatar/forum.devtalk.com/astonj/32/7_2.png) [@AstonJ](https://forum.devtalk.com/u/AstonJ)\
**Post date:** [3 February 2021 06:15 UTC](https://forum.devtalk.com/t/rails-console-using-100-cpu-in-dev-fix/6633/1 "2021-02-03T06:15:59Z")

</div>

If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issue - at least that’s what worked for me. Here’s my old and new (old versions are commented out):

```ruby
# group :development do
# # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
# gem 'web-console', '>= 3.3.0'
# gem 'listen', '>= 3.0.5', '< 3.2'
# # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
# gem 'spring'
# gem 'spring-watcher-listen', '~> 2.0.0'
# end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 4.1.0'
  # Display performance information such as SQL time and flame graphs for each request in your browser.
  # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
  gem 'rack-mini-profiler', '~> 2.0'
  gem 'listen', '~> 3.3'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

# group :test do
# # Adds support for Capybara system testing and selenium driver
# gem 'capybara', '>= 2.15'
# gem 'selenium-webdriver'
# # Easy installation and use of web drivers to run system tests with browsers
# gem 'webdrivers'
# end

group :test do
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '>= 3.26'
  gem 'selenium-webdriver'
  # Easy installation and use of web drivers to run system tests with browsers
  gem 'webdrivers'
end

```

Hope this saves someone a few hours of faffing around trying to troubleshoot the issue! 🙃

---

<div class="post-metadata">

**Author:** ![ohm](https://forum.devtalk.com/user_avatar/forum.devtalk.com/ohm/32/559_2.png) [@ohm](https://forum.devtalk.com/u/ohm)\
**Post date:** [3 February 2021 10:22 UTC](https://forum.devtalk.com/t/rails-console-using-100-cpu-in-dev-fix/6633/3 "2021-02-03T10:22:45Z")

</div>

It was probably `listen`. `listen` 3.3.0 fixed a lot of threading and process problems.

---

<div class="post-metadata">

**Author:** ![AstonJ](https://forum.devtalk.com/user_avatar/forum.devtalk.com/astonj/32/7_2.png) [@AstonJ](https://forum.devtalk.com/u/AstonJ)\
**Post date:** [3 February 2021 21:56 UTC](https://forum.devtalk.com/t/rails-console-using-100-cpu-in-dev-fix/6633/4 "2021-02-03T21:56:04Z")

</div>

Glad they sorted it because it was driving me crazy! 😂

Stopping the server wasn’t enough either, you needed to quit terminal completely 🤦‍♂️

---

<div class="post-metadata">

**Author:** ![ohm](https://forum.devtalk.com/user_avatar/forum.devtalk.com/ohm/32/559_2.png) [@ohm](https://forum.devtalk.com/u/ohm)\
**Post date:** [4 February 2021 07:08 UTC](https://forum.devtalk.com/t/rails-console-using-100-cpu-in-dev-fix/6633/5 "2021-02-04T07:08:45Z")

</div>

I’ve had some trouble with `spring` just sitting there as well. `spring` is used to preload the app, so you can tear down and start up a server or console snappy.
