# [Ruby On Rails][rspec] 解決FATAL: database "專案名稱" does not exist 錯誤
###### tags: `Ruby On Rails`,`rspec`
>若遇到user not exist error,
>請參考 [[Postgresql]解決Fatal: role “username” does not exist 錯誤](/p24HhyiqR--MvsFXguX2Bw)
參考資料:
https://github.com/rspec/rspec-rails/issues/949
在使用rspec的時候,
若沒有用目前登入之使用者建立以專案名稱命名的資料庫,
就會出現FATAL: database "專案名稱" does not exist 等錯誤.
解決方式:
建一個以專案為名的資料庫即可.
terminal
```terminal
rake db:test:prepare
```
rspec預設會強制使用者在建立rails專案時也一併建立以專案為名的資料庫,若是用預設的方式建立專案應該不會碰到這個錯誤,
但因為我是用遠端而非本地的資料庫,所以遇到這個問題,
把它紀錄起來以便日後查找之用.