LoginSignup
5
2

More than 5 years have passed since last update.

RSpecでバージョン違いのエラーが出る場合の対処法

Last updated at Posted at 2012-07-28

RSpecって、rspec specって打てばいいんだよね?
っと思ったらこんなエラーが発生。

`block in setup': You have already activated rspec-core 2.10.1, but
your Gemfile requires rspec-core 2.8.0. Using bundle exec may solve
this. (Gem::LoadError)

エイリアスで

alias be= bundle exec

と設定しているので、be rspec specって打てば動くだろうと思ったら、同じエラーが出て動かない。

結局、エイリアスを使わずに

$ bundle exec rspec spec

って打ったら動いた。

$ bundle exec rspec

でもOK。

しかし、なんでエイリアスを使ったらエラーが出るんだろう?と思ってさらに調べてみた。
なんかエイリアスの設定がおかしかった。。。

alias be= bundle exec

じゃなくて

alias be="bundle exec"

とすべきだった。ああ〜。

5
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
2