fir*_*dev 2 rspec ruby-on-rails guard rbenv
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)
Run Code Online (Sandbox Code Playgroud)
我知道我可以做bundle update或者gem uninstall指定确切的版本Gemfile.
有没有办法一劳永逸地解决这个问题?所以警卫发射bundle exec rspec或bin/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)
...
Run Code Online (Sandbox Code Playgroud)
所以在潜伏了一段时间后我修改Guardfile了一下:
之前:
guard :rspec do
Run Code Online (Sandbox Code Playgroud)
后:
guard :rspec, cmd: 'bundle exec rspec' do
Run Code Online (Sandbox Code Playgroud)
这一劳永逸地解决了这个问题.
| 归档时间: |
|
| 查看次数: |
537 次 |
| 最近记录: |