Dockerにrailsの環境を構築しました。
docker-compose run web rails g model user name:string age:stringの後に
docker-compose web rails g rake db:migrateを行いコンテナ内にDBを作成しました。
ocker-compose run web /bin/bashを実行しコンテナ内にdbができているのか確認したところ出来ていませんでした。
またrails consoleでDB確認しようとしたところ
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
上記のエラーメッセージが表示されました。解決方法がわからないのでわかるかたがいましたら教えてください
あなたの回答
tips
プレビュー