質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

PostgreSQL

PostgreSQLはオープンソースのオブジェクトリレーショナルデータベース管理システムです。 Oracle Databaseで使われるPL/SQLを参考に実装されたビルトイン言語で、Windows、 Mac、Linux、UNIX、MSなどいくつものプラットフォームに対応しています。

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

Q&A

解決済

1回答

427閲覧

docker-compose upをするとローカルサーバーが真っ白になってしまします

jonason

総合スコア8

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

PostgreSQL

PostgreSQLはオープンソースのオブジェクトリレーショナルデータベース管理システムです。 Oracle Databaseで使われるPL/SQLを参考に実装されたビルトイン言語で、Windows、 Mac、Linux、UNIX、MSなどいくつものプラットフォームに対応しています。

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

0グッド

0クリップ

投稿2019/10/30 11:26

編集2019/10/30 11:34

$ docker-compose up
Creating network "coconara-ruby-dev_default" with the default driver
Creating coconara-ruby-dev_db_1 ... done
Creating coconara-ruby-dev_web_1 ... done
Attaching to coconara-ruby-dev_db_1, coconara-ruby-dev_web_1
db_1 | 2019-10-30 11:08:58.112 UTC [1] LOG: starting PostgreSQL 12.0 (Debian 12.0-2.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
db_1 | 2019-10-30 11:08:58.112 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
db_1 | 2019-10-30 11:08:58.112 UTC [1] LOG: listening on IPv6 address "::", port 5432
db_1 | 2019-10-30 11:08:58.116 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1 | 2019-10-30 11:08:58.129 UTC [22] LOG: database system was interrupted; last known up at 2019-10-30 11:03:08 UTC
db_1 | 2019-10-30 11:08:58.360 UTC [22] LOG: database system was not properly shut down; automatic recovery in progress
db_1 | 2019-10-30 11:08:58.362 UTC [22] LOG: redo starts at 0/167A300
db_1 | 2019-10-30 11:08:58.362 UTC [22] LOG: invalid record length at 0/167A338: wanted 24, got 0
db_1 | 2019-10-30 11:08:58.362 UTC [22] LOG: redo done at 0/167A300
db_1 | 2019-10-30 11:08:58.378 UTC [1] LOG: database system is ready to accept connections
web_1 | => Booting Puma
web_1 | => Rails 5.2.3 application starting in development
web_1 | => Run rails server -h for more startup options
web_1 | Puma starting in single mode...
web_1 | * Version 3.12.1 (ruby 2.6.3-p62), codename: Llamas in Pajamas
web_1 | * Min threads: 5, max threads: 5
web_1 | * Environment: development
web_1 | * Listening on tcp://0.0.0.0:3000
web_1 | Use Ctrl-C to stop
web_1 | Started GET "/" for 172.25.0.1 at 2019-10-30 11:10:41 +0000
web_1 | (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
web_1 | ↳ /usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98
web_1 | Processing by HomeController#index as HTML
web_1 | Rendering home/index.html.erb within layouts/application
web_1 | Rendered home/index.html.erb within layouts/application (7.7ms)
web_1 | Completed 200 OK in 106ms (Views: 82.9ms | ActiveRecord: 0.0ms)
web_1 |
web_1 |

localhosut:3000がずっと真っ白な画面になっています
調べても意味がよくわからないサイトばかりでどうしたらいいのか困っています

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

kazto

2019/10/30 12:11

docker-compose.yml、およびDockerfileをご提示ください。
jonason

2019/10/30 12:40 編集

Dockerfileは以下のようになっております FROM ruby:2.6.3 RUN apt-get update -qq && apt-get install -y nodejs postgresql-client RUN mkdir /coconara-ruby-dev WORKDIR /coconara-ruby-dev COPY Gemfile /coconara-ruby-dev/Gemfile COPY Gemfile.lock /coconara-ruby-dev/Gemfile.lock RUN bundle install COPY . /coconara-ruby-dev # Add a script to be executed every time the container starts. COPY entrypoint.sh /usr/bin/ RUN chmod +x /usr/bin/entrypoint.sh ENTRYPOINT ["entrypoint.sh"] EXPOSE 3000 # Start the main process. CMD ["rails", "server", "-b", "0.0.0.0"] またdocker-compose.ymlは以下のようになっております version: '3' services: db: image: postgres ports: - '5432:5432' volumes: - postgresql-data:/var/lib/postgresql/data web: build: . command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'" volumes: - .:/coconara-ruby-dev ports: - "3000:3000" depends_on: - db volumes: postgresql-data: driver: local
jonason

2019/10/30 14:33 編集

docker-compose.ymlの中の volumes: - .:/coconara-ruby-dev の名前が違っていて直したら layouts/application.html.erbの内容のみは表示できるようになりました。 他のviewのページが反映されないです・。
jonason

2019/10/30 12:24

コマンドが以下のようになっています $ docker-compose up Starting coconara-ruby-dev_db_1 ... done Recreating coconara-ruby-dev_web_1 ... done Attaching to coconara-ruby-dev_db_1, coconara-ruby-dev_web_1 db_1 | 2019-10-30 12:15:00.710 UTC [1] LOG: starting PostgreSQL 12.0 (Debian 12.0-2.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit db_1 | 2019-10-30 12:15:00.711 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 db_1 | 2019-10-30 12:15:00.711 UTC [1] LOG: listening on IPv6 address "::", port 5432 db_1 | 2019-10-30 12:15:00.714 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" db_1 | 2019-10-30 12:15:00.732 UTC [22] LOG: database system was shut down at 2019-10-30 12:14:46 UTC db_1 | 2019-10-30 12:15:00.737 UTC [1] LOG: database system is ready to accept connections web_1 | => Booting Puma web_1 | => Rails 5.2.3 application starting in development web_1 | => Run `rails server -h` for more startup options web_1 | Puma starting in single mode... web_1 | * Version 3.12.1 (ruby 2.6.3-p62), codename: Llamas in Pajamas web_1 | * Min threads: 5, max threads: 5 web_1 | * Environment: development web_1 | * Listening on tcp://0.0.0.0:3000 web_1 | Use Ctrl-C to stop web_1 | Started GET "/introduce" for 172.25.0.1 at 2019-10-30 12:15:19 +0000 web_1 | (2.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC web_1 | ↳ /usr/local/bundle/gems/activerecord-5.2.3/lib/active_record/log_subscriber.rb:98 web_1 | Processing by IntroduceController#index as HTML web_1 | Rendering introduce/index.html.erb within layouts/application web_1 | Rendered introduce/index.html.erb within layouts/application (8.2ms) web_1 | Completed 200 OK in 85ms (Views: 69.1ms | ActiveRecord: 0.0ms) web_1 | web_1 | web_1 | Started GET "/" for 172.25.0.1 at 2019-10-30 12:15:27 +0000 web_1 | Processing by HomeController#index as HTML web_1 | Rendering home/index.html.erb within layouts/application web_1 | Rendered home/index.html.erb within layouts/application (0.5ms) web_1 | Completed 200 OK in 36ms (Views: 24.1ms | ActiveRecord: 0.0ms) web_1 | web_1 | web_1 | Started GET "/" for 172.25.0.1 at 2019-10-30 12:15:52 +0000 web_1 | Processing by HomeController#index as HTML web_1 | Rendering home/index.html.erb within layouts/application web_1 | Rendered home/index.html.erb within layouts/application (0.4ms) web_1 | Completed 200 OK in 67ms (Views: 41.6ms | ActiveRecord: 0.0ms) web_1 | web_1 | web_1 | Started GET "/introduce" for 172.25.0.1 at 2019-10-30 12:16:03 +0000 web_1 | Processing by IntroduceController#index as HTML web_1 | Rendering introduce/index.html.erb within layouts/application web_1 | Rendered introduce/index.html.erb within layouts/application (0.6ms) web_1 | Completed 200 OK in 59ms (Views: 35.2ms | ActiveRecord: 0.0ms) web_1 | web_1 | web_1 | Started GET "/" for 172.25.0.1 at 2019-10-30 12:16:11 +0000 web_1 | Processing by HomeController#index as HTML web_1 | Rendering home/index.html.erb within layouts/application web_1 | Rendered home/index.html.erb within layouts/application (0.5ms) web_1 | Completed 200 OK in 77ms (Views: 55.0ms | ActiveRecord: 0.0ms) web_1 | web_1 | web_1 | Started GET "/" for 172.25.0.1 at 2019-10-30 12:18:56 +0000 web_1 | Processing by HomeController#index as HTML web_1 | Rendering home/index.html.erb within layouts/application web_1 | Rendered home/index.html.erb within layouts/application (0.6ms) web_1 | Completed 200 OK in 54ms (Views: 33.3ms | ActiveRecord: 0.0ms) web_1 | web_1 | web_1 | Started GET "/introduce" for 172.25.0.1 at 2019-10-30 12:19:05 +0000 web_1 | Processing by IntroduceController#index as HTML web_1 | Rendering introduce/index.html.erb within layouts/application web_1 | Rendered introduce/index.html.erb within layouts/application (0.6ms) web_1 | Completed 200 OK in 66ms (Views: 48.2ms | ActiveRecord: 0.0ms) web_1 | web_1 |
guest

回答1

0

自己解決

docker-compose.ymlの中の
volumes:

  • .:/coconara-ruby-dev

の名前が違っていて直したら
layouts/application.html.erbの内容のみは表示できるようになりました。
他のviewのページが反映されないです・。

投稿2019/10/30 14:34

jonason

総合スコア8

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問