Ruby on Rails 控制台在加载时挂起 [英] Ruby on Rails console is hanging when loading

查看:16
本文介绍了Ruby on Rails 控制台在加载时挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,Ruby on Rails 控制台拒绝启动;它只是挂起.我没有对我的代码进行任何更改,使用相同版本的 Ruby 和 Ruby on Rails 的其他项目也没有问题.当我最终 Ctrl + C 我得到这个堆栈跟踪,它指向 Spring.

For whatever reason, the Ruby on Rails console refuses to start; it just hangs. I haven't made any changes to my code, and other projects using the same version of Ruby and Ruby on Rails have no issue. When I finally Ctrl + C I get this stack trace, which points to Spring.

我无法解释为什么这种情况从一个时刻发生到下一个时刻,它工作正常.我已经通过 RVM 清除了所有的 gem,并通过 bundle 命令重新安装,但仍然没有运气.任何想法将不胜感激.

I can't explain why this is happening from one moment to the next, where it was working fine. I have cleared out all the gems through RVM and reinstalled all through bundle command, but still no luck. Any ideas would be appreciated.

据我所知,Ruby on Rails 服务器也没有问题.该问题与项目相关,但没有更改任何代码,只有 Ruby on Rails 控制台存在问题.

Also the Ruby on Rails server has no issue so as far as I can tell. The issue is project related, however no code has changed, and it's only the Ruby on Rails console that has the issue.

Ruby 2.1.2
导轨 4.1.4

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$

推荐答案

重启 Spring 应该可以修复挂起的命令:

Restarting Spring should fix the hanging commands:

$ bin/spring stop

在删除并重新创建新的 Ruby on Rails 应用程序后,我遇到了挂起的命令(rake、bin/rails 等).谷歌没有那么有帮助.我希望是这样.

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 将自动启动.

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

这篇关于Ruby on Rails 控制台在加载时挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆