我正在铁道上上课程并且对宝石有些麻烦。
当我在新的rails项目上运行rspec时,我收到此错误:
/Users/mme/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:34:in `block in setup':
You have already activated poltergeist 1.9.0, but your Gemfile requires poltergeist 1.6.0.
Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
根据How to switch between different version of gem installed?,我应该可以使用bundle exec [gem]
$ bundle exec poltergeist
bundler: command not found: poltergeist
Install missing gem executables with `bundle install`
这没有意义 - 我之前使用过poltergeist:
$ bundle install | grep poltergeist
Using poltergeist 1.6.0
有没有人对如何调和这种情况有一些建议?
答案 0 :(得分:1)
尝试:
bundle exec rspec
错误表明"将bundle exec
添加到您的命令" - 字面意思是在bundle exec
命令之前添加rspec
。