簡體   English   中英

Rails - 由於 spring gem 無法運行 rails 服務器

[英]Rails - Can't run rails server because of spring gem

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

我知道這個問題是一個眾所周知的問題。

我已經研究解決問題,但我無法解決它。

以前有人遇到過這個問題嗎?

存在代碼問題。 我寫了我如何修復它的細節。

解決這個問題的方法

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM