0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

You've tried to invoke Spring when it's already loaded・・・ となり、rails sが出来なくなったときの対処法

Posted at

#rails sが突然動かなくなった

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.

Here's the backtrace:

/Users/user/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
(中略)
/Users/user/Desktop/rails_app/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'

エラー解決のために、「You've tried to invoke Spring when it's already loaded (i.e. the Spring constant is defined).」で検索してみると、この記事を発見。
記事通りにやっていくと解決できた。

#解決方法
どうやら、インストールしたgemのバージョンが古いのが原因らしい。
該当のgemの最新バージョンを調べ、gemfileのバージョンを最新版に書き直した後、bundle installをしたら無事治った。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?