LoginSignup
3
5

More than 5 years have passed since last update.

bundler: failed to load command: rspecとエラーが出た際の対処法

Posted at

はじめに

bundle exec rspecコマンドでrspecを実行しようとしたら、bundler: failed to load command: rspecとエラーが発生し、rspecが実行できませんでした。
対処法を載せておきます。

対処方法について

1. bundle doctorを実行

まずは、bundle doctorコマンドでトラブルの診断をしましょう。
私の場合は以下のようなエラーが出ました。

The Gemfile's dependencies are satisfied
The following gems are missing OS dependencies:
 * charlock_holmes: /usr/local/opt/icu4c/lib/libicudata.62.1.dylib
 * charlock_holmes: /usr/local/opt/icu4c/lib/libicui18n.62.dylib
 * charlock_holmes: /usr/local/opt/icu4c/lib/libicuuc.62.dylib

以下のgemにはOSの依存関係がありません、と言われています。この場合は「charlock_holmes」というgemですね。

2. 指摘されたgemのuninstall

bundle doctorで指摘されたgemをまずはuninstallして、bundle installします。

bundle exec gem uninstall gem名
bundle install

そして、再度bundle doctorコマンドを実行し、以下のように返って来れば成功です。

The Gemfile's dependencies are satisfied
No issues found with the installed bundle
3
5
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
3
5