1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Railsでgem rswag使って起動しようとしたらstaging/productionでエラー

1
Last updated at Posted at 2019-06-19

問題: Ruby on Railsのgem rswag を導入したところ、それまで動いていたstaging環境のサーバー起動(rails s)でエラーが出るようになった

原因: Gemfileで指定しているgroupが、そもそもテスト環境までであればいいと思い、下記のようにしていた。

group :development, :test do
  gem 'rswag'
end

解決: テストで使う部分と全体で読み込んでおく必要があるものを分けた。

全体

gem 'rswag-api'
gem 'rswag-ui'

group テスト

group :test do
  gem 'rspec-rails'
  gem 'rswag-specs'
end

参考にさせていただいた記事
https://github.com/domaindrivendev/rswag/issues/77

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?