ruby-on-rails - Rails - 由于 spring gem 无法运行 rails 服务器
问题描述
当我昨天可以在本地运行 rails 项目时。
但是今天我无法运行具有以下问题的项目。
我什么都没做。我正在使用Spring 2.1.0
$ rails s
=> Booting Puma
=> Rails 5.2.4.1 application starting in development
=> Run `rails server -h` for more startup options
Exiting
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.
Here's the backtrace:
/Users/admin/.rvm/gems/ruby-2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
/Users/admin/.rvm/gems/ruby-2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
/Users/admin/.rvm/gems/ruby-2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:285:in `block in load'
/Users/admin/.rvm/gems/ruby-2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:257:in `load_dependency'
/Users/admin/.rvm/gems/ruby-2.5.0/gems/activesupport-5.2.4.1/lib/active_support/dependencies.rb:285:in `load'
/Users/admin/.rvm/gems/ruby-2.5.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
/Users/admin/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/Users/admin/.rvm/rubies/ruby-2.5.0/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/work/halfhelix/floravere/heroku_floravere_dev/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
我知道这个问题是一个众所周知的问题。
我已经研究解决问题,但我无法解决它。
以前有人遇到过这个问题吗?
解决方案
存在代码问题。我写了我如何修复它的细节。
推荐阅读
- php - $_POST 返回空白值
- python - 对于具有 `set[int]` 值的数据,基于具有至少一个共同成员的分组存在哪些快速方法?
- sparql - 没有得到我从 Wikidata sparql 查询中查看的汇总结果
- python - 每月对数据框列进行 Winsorize,同时忽略 NaN
- java - Camel 总是将消息路由到预期 Kafka 主题的 0 分区
- google-sheets - 在 Google 表格中的单元格中的 URL 中插入动态值
- css - 如何使用 CSS 简单地更改 wordpress 中字段标签的文本?
- windows - 需要帮助从 Windows 10 .BAT 文件运行嵌套程序调用而没有“不支持 UNC 路径”错误
- java - 如何使用多个填充段格式化 Java 字符串
- discord.js - discord.js v12 | TypeError:无法读取未定义的属性“发送”