railsのplugin開発をしていてrspecの速度を上げたくてspringを導入しようとしました。 その時にエラーがでました。 その対処法をメモ。
bundle exec spring binstub rspec
上記コマンドを実行した時に下記のエラーが出ました
Spring was unable to find your config/application.rb file. Your project root was detected at /path/to/plugin, so spring looked for /path/to/plugin/config/application.rb but it doesn't exist. You can configure the root of your application by setting Spring.application_root in config/spring.rb.
pluginなのでapplication.rb
はないです。
メッセージに表示されているようにconfig/spring.rb
を用意します。
vi config/spring.rb
中身は下記のようなものを書きます。
Spring.application_root = './spec/dummy' Spring.watch 'app/modles', 'lib'
で下記のように実行すれば使えました。
./spec/dummy/bin/rspec ./spec/path/to/xxxx_spec.rb
参考