【发布时间】:2021-03-18 06:49:24
【问题描述】:
我创建了一个新的 rails 应用程序文件夹,运行顺利。进入此类文件夹后,运行任何类型的 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.
我现在有
spring -v
Spring version 2.1.0
我尝试了以下方法,得到了相同的结果。我也试过卸载spring并重新安装。
bundle exec spring binstub --all
* bin/rake: Spring already present
* bin/rails: Spring already present
【问题讨论】:
-
你试过运行
bundle exec spring binstub --all吗? -
是的,它似乎没有做任何改变。
-
stackoverflow.com/questions/38664754/… 中的一些步骤可能会有所帮助
-
我已经尝试了该帖子中的指示,但仍然无法正常工作。不知何故运行
gem pristine --all解决了这个问题,但不知道为什么 -
gem pristine --all给我留下了ERROR: While executing gem ... (Errno::EPERM) Operation not permitted @ apply2files - /Users/xxxxxxxxxx/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionmailbox-6.1.4/CHANGELOG.md
标签: ruby-on-rails spring