AstonJ

AstonJ

Rails console using 100% CPU in dev (fix)

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):

# 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! :upside_down_face:

Most Liked

ohm

ohm

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

ohm

ohm

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.

Popular Backend topics Top

wolf4earth
Serverless has been quite a prevalent topic in our industry in the past few years, and while there are a lot of sceptics, I think it’s sa...
New
New
CommunityNews
The Magic of Python Context Managers. Recipes for using and creating awesome Python context managers, that will make your code more read...
New
First poster: bot
What's so exciting about Postgres? with Craig Kerstiens (The Changelog #417). PostgreSQL aficionado Craig Kerstiens joins Jerod to talk ...
New
finner
I’ve never really felt 100% comfortable using the enum type because of my lack of understanding how it is constructed . . . . . . until ...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
jaeyson
Hi all!, anybody tried this Elixir quiz from @Tetiana? She’s the one who made Elixircards.
New
pillaiindu
Cross posting from Elixir Forum. Build it with Phoenix is a nice course by Geoffrey Lessel @geo. But if you start with Phoenix 1.7.2 or ...
New
KnowledgeIsPower
Do you just use plain Terraform alone? Do you use CDK for Terraform or other supporting tools (e.g. Terraform Cloud ) for Terraform?
New
pillaiindu
Hi everyone, Does anyone know when will “Agile Web Development in Rails 8” by Pragmatic Bookshelf release. I’m eager to dive into the la...
New

Other popular topics Top

DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New
PragmaticBookshelf
A Hero’s Journey with Chris Pine @chrispine Chris Pine, author of Learn to Program, Third Edition, discusses his journey to beco...
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New