Ruby on Rails Console Is Hanging When Loading

Ruby on Rails console is hanging when loading

Restarting Spring should fix the hanging commands:

$ bin/spring stop

I experienced hanging commands (rake, bin/rails, etc.) after deleting and recreating a new Ruby on Rails application. Google wasn't that helpful. I hope this is.

Spring will start automatically when you re-run your command.

Console not loading server

rails console isn't supposed to run the server. It's the console, and you just mess with it, typing stuff inside and getting replies from it via on-screen text messages.

Everything's working fine, you may continue venturing into the mysterious and rewarding world of Ruby on Rails development.

Why all constants not loading on pry console in rails project root dir?

To expand on the comments, what's being said is to install the pry-rails gem in your Gemfile.

pry alone works the same as irb (a Ruby console, outside of the project's context), while using pry-rails means rails c will load using pry with all its functionality. And therefore access to the required constants.

This will also allow you to use the binding.pry breakpoints within the code, as desired.

Alternatively, if you load rails c with the pry gem installed, you should be able to run the command pry within that (you might need to require 'pry' ahead of this), and it jump to using pry within the project's context. This will be handy if you're not able to add the pry-rails gem to the project's dependencies.

(Whew - that's a lot of 'pry's.)

Hope that helps - let me know if you've any questions.

rails console doesn't start

I may be answering a bit late for this, but for the sake of the others who are looking for the answer... it's here

Basically, enter this command

spring stop

The issue , as far as I understand, is with the spring gem, specifically, it checks the server for versions, which doesn't tally up.

For my case, the problem started when when I add some new gems into the gemfile.

So once you stop spring and type in any other rails command, spring restart, and every thing should work again, at least until the same problem occurs, or the dev patched the issue.



Related Topics



Leave a reply



Submit