ruby-on-rails - 尝试执行 rails 命令时与 spring 相关的错误

标签 ruby-on-rails spring

我创建了一个新的 rails 应用程序文件夹,运行顺利。一旦进入这样的文件夹,运行任何类型的 rails 命令,如 rails s会提示我:

You've tried to invoke Spring when it's already loaded (i.e. the Spring constant is defined).

This is probably because you generated binstubs with Spring 1.0, and you now have a Spring version > 1.0 on your system. To solve this, upgrade your bundle to the latest Spring version and then run `bundle exec spring binstub --all` to regenerate your binstubs. This is a one-time step necessary to upgrade from 1.0 to 1.1.

我目前有
spring -v
Spring version 2.1.0

我尝试了以下方法,得到相同的结果。我也尝试卸载 spring 并重新安装。
 bundle exec spring binstub --all
* bin/rake: Spring already present
* bin/rails: Spring already present

最佳答案

在尝试所有其他相关解决方案以最终找到隐藏在评论中的问题后,将此作为答案发布。希望它可以帮助将来的某个人。
至于原因,我看到的唯一原因是从 ubuntu (pop os) 20.04 升级到 20.10。在我的两次编码 session 之间没有做任何其他事情。

I've tried the indications in that post and kept not working. Somehow running gem pristine --all solves the issue, but not sure why – Gotey Jan 3 at 14:05

关于ruby-on-rails - 尝试执行 rails 命令时与 spring 相关的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59579627/

相关文章:

ruby-on-rails - 如何在 Rails 应用程序中强制使用 gem 版本?

ruby-on-rails - 在惯用的 ActiveRecord 中查找或创建唯一的关联对象?

spring - 用于嵌入式套接字监听器的 Netty/Grails Web 集成

ios - 如何将 "Log In via Twitter"凭据从 Rails 后端传递到 iPhone 应用程序?

ruby-on-rails - sidekiq 不会发送异常通知电子邮件

java - 如何在 MockRestServiceServer 中验证 json 请求正文

java - vaadin & Spring 启动 : compiled widgetset is missed in jar package

java - Spring MVC 在页面中只提交渲染列表的一个元素

ruby-on-rails - 尝试加载 gem 'factory_girl_rails' 时出错。 ( bundler ::GemRequireError)

java - Spring - 构建路径不完整。在 dispatcher-servlet.xml 中找不到 org/springframework/beans/factory/Aware 的类文件