gpt4 book ai didi

ruby-on-rails - bundler + 防护 + Rspec + Rbenv = "You have already activated..."

转载 作者:行者123 更新时间:2023-12-01 22:16:44 25 4
gpt4 key购买 nike

Guard 总是因为这个问题而困扰我:

.../gems/bundler-1.6.2/lib/bundler/runtime.rb:34:in `block in setup': You have already activated multi_json 1.10.0, but your Gemfile requires multi_json 1.9.2. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)

我知道我可以进行捆绑更新gem卸载或在Gemfile中指定确切的版本。

有没有办法一劳永逸地修复它,以便guard启动bundle exec rspecbin/rspec(我正在使用rbenv )?我想我在 github 上的某个地方看到了一个补丁,但现在找不到了。

更新

这里只是为了记录一下即使使用 bundle exec 也会发生的情况:

$ bundle exec guard
17:11:07 - INFO - Guard is using TerminalNotifier to send notifications.
17:11:07 - INFO - Guard is using TerminalTitle to send notifications.
17:11:07 - INFO - Guard::RSpec is running
17:11:07 - INFO - Guard is now watching at '/Sites/site'
[1] guard(main)>
17:11:10 - INFO - Run all
17:11:10 - INFO - Running all specs
WARN: Unresolved specs during Gem::Specification.reset:
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
listen (~> 2.7)
formatador (>= 0.2.4)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
WARN: Unresolved specs during Gem::Specification.reset:
debugger-ruby_core_source (~> 1.3.2)
rb-inotify (>= 0.9)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
.../.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:34:in `block in setup': You have already activated formatador 0.2.5, but your Gemfile requires formatador 0.2.4. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
...

最佳答案

因此,在潜伏了一段时间后,我对 Guardfile 进行了一些修改:

之前:

guard :rspec do

之后:

guard :rspec, cmd: 'bundle exec rspec' do

一劳永逸地解决了这个问题。

关于ruby-on-rails - bundler + 防护 + Rspec + Rbenv = "You have already activated...",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23606594/

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