前回の続きです。
Gemfileの中身がなぜか書き換わっていたので、もう一度入力して
source "https://rubygems.org"
gem "rspec", ">= 3.0.0"gem "rspec-legacy_formatters"
bundle install
![](https://reiji649807408.files.wordpress.com/2021/04/image-85.png?w=1256)
お、なんかできてるっぽい出力です。
Gemfile.lockの中身にも追記されています。
![](https://reiji649807408.files.wordpress.com/2021/04/image-86.png?w=1256)
今度こそ、initオプションを付けてコマンドでrspecを初期化します
bundle exec rspec –init
前回とは違うエラーが出ました
![](https://reiji649807408.files.wordpress.com/2021/04/image-87.png?w=1256)
bundle exec rspec –init
本来はハイフン二つだったみたいです。
以下のコマンドでやる方法もあるみたいです。
(bundle exec rails g rspec:install)
(こちらの方法では、rails_helper.rb が追加されるとのこと。)
再度実行しましたが、同じエラー…
![](https://reiji649807408.files.wordpress.com/2021/04/image-88.png?w=1256)
試しに、こっちも試してみます。
bundle exec rails g rspec:install
なにか足りてないみたいですね….
![](https://reiji649807408.files.wordpress.com/2021/04/image-89.png?w=1256)
試しに–initなくして実行してみます
bundle exec rspec
![](https://reiji649807408.files.wordpress.com/2021/04/image-90.png?w=1256)
ダメですね…
コメント