Rails-由于春季宝石而无法运行Rails服务器 [英] Rails - Can't run rails server because of spring gem

查看:147
本文介绍了Rails-由于春季宝石而无法运行Rails服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我什么时候可以在本地运行rails项目.

When I could run the rails project yesterday on local.

但是今天我无法运行具有以下问题的项目.

But today I can't run the project with the below issues.

我什么都没做. 我正在使用 Spring 2.1.0

I haven't done anything. I am using 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>'

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

I know this issue is a commonly known issue.

我已经研究出解决问题的方法,但无法解决.

I have researched to fix issues but I couldn't fix it.

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

Anyone had this issue before?

推荐答案

出现代码问题. 我写了详细的修复方法.

There was a code issue. I wrote the details how I fixed it.

解决此问题的方法

这篇关于Rails-由于春季宝石而无法运行Rails服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆