【问题标题】:Rails - Can't run rails server because of spring gemRails - 由于 spring gem 无法运行 rails 服务器
【发布时间】:2020-01-24 09:56:34
【问题描述】:

当我昨天可以在本地运行 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>'

我知道这个问题是一个众所周知的问题。

我已经研究过要解决的问题,但我无法解决。

以前有人遇到过这个问题吗?

【问题讨论】:

  • 如果你执行它的建议? bundle exec spring binstub --all
  • 试试bin/spring stop
  • @Fernand,这对我没有帮助。
  • @HardikUpadhyay,这对我没有帮助。
  • 你试过这个stackoverflow.com/a/38666916/6270554 吗?

标签: ruby-on-rails ruby rubygems


【解决方案1】:

存在代码问题。 我写了我如何修复它的细节。

The way to fix this issue

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-06-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多