Ruby on console rails hangs when loading

For some reason, the rails console refuses to start, it just hangs. I have not made any changes to my code, and other projects using the same version of rubies and rails do not have a problem. When I finally Ctrl + C, I get this stack trace that points to spring.

I can’t explain why this happens from one moment to another, where it works fine. I cleared all the gems through RVM and reinstalled the entire beam team, but still no luck. Any ideas would be good.

In addition, the rails server has no problem, as far as I can tell, the problem is related to the project, however the code has not changed, and its only rails console in which there is a problem.

Ruby 2.1.2 Rails 4.1.4

user_a@ubuntu:~/work/app_a$ rails console ^C/home/user_a/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/run.rb:54:in `gets': Interrupt from /home/user_a/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/run.rb:54:in `verify_server_version' from /home/user_a/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/run.rb:25:in `call' from /home/user_a/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call' from /home/user_a/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/rails.rb:23:in `call' from /home/user_a/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call' from /home/user_a/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client.rb:26:in `run' from /home/user_a/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/bin/spring:48:in `<top (required)>' from /home/user_a/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load' from /home/user_a/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>' from /home/user_a/work/app_a/bin/spring:16:in `require' from /home/user_a/work/app_a/bin/spring:16:in `<top (required)>' from bin/rails:3:in `load' from bin/rails:3:in `<main>' user_a@ubuntu:~/work/app_a$ 
+127
ruby ruby-on-rails console
Jul 30 '14 at 1:01
source share
3 answers

Restarting spring should fix the suspension commands:

 $ bin/spring stop 

After uninstalling and re-creating the new Rails application, I got suspension commands (rake, bin / rails, etc.). Google was not so helpful. I hope so.

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

+379
Aug 07
source share

Something is wrong with the spring version of gem, I think.

Go to the Gemfile and the gem 'spring' comment. Then run the package installation and try again.

 # gem 'spring' 

then

 bundle install 

If your work depends on a gem, try updating the gems:

 bundle update 
+7
Jul 30 '14 at 1:12
source share

If $ bin/spring stop tells you that Spring is not working, then check if there are any Spring orphans left:

 $ ps aux | grep -i spring 

If you see something like

 user 7163 0.0 0.0 110356 2165 pts/3 S+ 19:40 0:00 grep --color=auto -i spring user 16980 0.0 0.4 398826 17580 ? Sl Aug31 0:00 spring server | current | started 277 hours ago 

then start the failed Spring process and try starting the console again:

 $ kill -9 16980 $ rails c 
+1
Sep 11 '17 at 19:50
source share



All Articles