Rails 5, Rspec: Environment data not found in the schema

New Rails 5 command to generate binstubs:

rails app:update:bin

Allows me to run the solution as the error suggested:

bin/rails db:environment:set RAILS_ENV=test

Tip from @max comment: If you are using database_cleaner and this error keeps popping up then change your config to:

DatabaseCleaner.clean_with(
  :truncation,
  except: %w(ar_internal_metadata)
)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)