gpt4 book ai didi

ruby-on-rails - 收到错误 "You' 我尝试在已经加载时调用 Spring“当我尝试启动服务器时

转载 作者:行者123 更新时间:2023-12-04 13:14:19 27 4
gpt4 key购买 nike

当我尝试在我的本地计算机上运行“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/emmetgibney/.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'
/Users/emmetgibney/.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'
/Users/emmetgibney/.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'
/Users/emmetgibney/.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'
/Users/emmetgibney/.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'
/Users/emmetgibney/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<main>'
/Users/emmetgibney/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/Users/emmetgibney/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/Users/emmetgibney/Dropbox/Programming/tableread/tableread/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'

我的机器上安装了 Spring 2.1.0 版。我已经运行了错误消息询问的命令,bundle exec spring binstub --all 并且错误仍然存​​在。我阅读了另一个 SO 答案以尝试运行 bundle exec spring binstub --remove --all 确实删除了 binstubs,然后我再次运行第一个命令以重新生成它们。仍然出现相同的错误。

即使在其他 Rails 应用程序上,问题仍然存在。例如,当我在我的机器上切换到另一个应用程序并运行 rails s 时,我得到了同样的错误,即使我可能已经有几周没有使用该应用程序了。

问题是在安装 Docsplit 及其所需的依赖项以及 google-cloud-text_to_speech 之后出现的。可能值得注意的是,我的系统也不允许我卸载 google-cloud-text_to_speech gem。

我使用的是 MacOS 10.13.6

最佳答案

我设法解决了这个问题。当我删除 spring gem 并尝试启动我的 rails 服务器时,我收到以下消息:

/Users/emmetgibney/.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:23:in `require': dlopen(/Users/emmetgibney/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/pg-1.2.3/lib/pg_ext.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (LoadError)

这让我觉得这可能是 postgres 的问题,所以我使用 brew 卸载并重新安装了 postgres,这似乎已经解决了它。我现在可以为这个应用启动我的 Rails 服务器,也可以为我的所有其他应用启动 Rails 服务器。

自从很久以前安装 postgres 以来,我还没有涉及到它,所以我不知道 postgres 一开始是怎么搞砸的,但它现在仍然可以工作。

关于ruby-on-rails - 收到错误 "You' 我尝试在已经加载时调用 Spring“当我尝试启动服务器时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61887789/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com