簡體   English   中英

腳手架新 Ruby on Rails 應用程序導致 spring 錯誤

[英]Scaffolding new Ruby on Rails app leads to spring error

在發現它的已部署版本已停止運行后,我曾嘗試在本地運行 Rails 應用程序,但出現以下錯誤。 困惑的是,我試圖搭建一個新的 Rails 應用程序並得到同樣的錯誤。 任何幫助將非常感激。

Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4).
We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.
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:

/home/user/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
/home/user/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
/home/user/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:319:in `block in load'
/home/user/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/user/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:319:in `load'
/home/user/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<main>'
/home/user/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/home/user/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/home/user/code/rails-who/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'

您是否遵循警告信息說明?

Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4).
We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.
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.

我會嘗試警告消息中建議的兩件事:

1.) 運行命令gem install bundler:2.1.4

2.) 重新生成你的 binstubs bundle exec spring binstub --all

暫無
暫無

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

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