Is there a way to get out of a hung state in IRB?
Press Control + D
once or twice. That should do it.
How to get unstuck in Ruby irb?
You can press ctrl + c followed by return to get back IRB's prompt.
Command line / IRB won't return values - Ruby
This occurs when you have entered an incomplete expression that requires closing characters of some kind to complete it. Example:
The ?
in the prompt indicates that the REPL is waiting on closing characters to evaluate the expression.
You can exit this state by completing the expression or by aborting its evaluation with Ctrl+c.
How do I step out of a loop with Ruby Pry?
To exit Pry unconditionally, type
exit-program
Edit from @Nick's comment: Also works:
!!!
Rails console (END) how to get past it?
stumbled over this problem, after some tries I found the solution :)
⇧ + Qshift
Edit: as mentioned by @Paul, only Q
will suffice.
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.
Can't stop rails server
You can use other ports like the following:
rails server -p 3001
Normally in your terminal you can try Ctrl + C
to shutdown the server.
The other way to kill the Ruby on Rails default server (which is WEBrick
) is:
kill -INT $(cat tmp/pids/server.pid)
In your terminal to find out the PID of the process:
$ lsof -wni tcp:3000
Then, use the number in the PID column to kill the process:
For example:
$ kill -9 PID
And some of the other answers i found is:
To stop the rails server while it's running, press:
CTRL-C
CTRL-Z
You will get control back to bash
. Then type (without the $
):
$ fg
And this will go back into the process, and then quit out of Rails s
properly.
It's a little annoying, but this sure beats killing the process manually. It's not too bad and it's the best I could figure out.
Updated answer:
You can use killall -9 rails
to kill all running apps with "rails
" in the name.
killall -9 rails
How do I clear stuck/stale Resque workers?
None of these solutions worked for me, I would still see this in redis-web:
0 out of 10 Workers Working
Finally, this worked for me to clear all the workers:
Resque.workers.each {|w| w.unregister_worker}
Related Topics
Does Ruby Have Syntax for Safe Navigation Operator of Nil Values, Like in Groovy
Obtaining a Facebook Auth Token for a Command-Line (Desktop) Application
Is Regexp.Last_Match Thread Safe
Missing File in Gem After Build
How to Get the Final Url After Redirects Using Ruby
Errno::Eaccess: Permission Denied @ Dir_S_Mkdir
Declaring an Integer Range with Step != 1 in Ruby
Why Aren't Global (Dollar-Sign $) Variables Used
How Can Bundler/Gemfile Be Configured to Use Different Gem Sources During Development
How to Render File in Rails 5 API
Accepts_Nested_Attributes_For Ignore Blank Values
"Encoding::Invalidbytesequenceerror" Error Occurs in Rails 3.1.0
Handling Iframe with Capybara Ruby
Ruby: Ssl_Connect Syscall Returned=5 Errno=0 State=Unknown State (Openssl::Ssl::Sslerror)
Rails 3. Simple_Format Do Not Wrap Result in Paragraph Tags