ruby ブラウザに表示できない。

実現したいこと

ブラウザに表示されるようにしたい。

環境

rvm install 3.2.3 rvm use 3.2.3 gem install bundler -v 2.3.14 gem install rails -v 7.1.3.2 nvm install 17.9.1 npm install -g yarn@1.22.19 cd config/ cp database.yml.sample database.yml less /etc/my.cnf cd .. ./bin/setup ./bin/cloud9_dev

発生している問題・分からないこと

以下のエラーが発生しました。

ターミナルのどの部分に問題がありますでしょうか。
よろしくお願いいたします。

※development.rbのソースコードは私が追加したものです。
イメージ説明

エラーメッセージ

error

1Sprockets::Rails::Helper::AssetNotFound in Fruits#index 2Showing /home/ec2-user/environment/raisetech-live8-sample-app/app/views/layouts/application.html.slim where line #8 raised: 3 4The asset "application.css" is not present in the asset pipeline

該当のソースコード

; @output_buffer.safe_concat(((::Temple::Utils.escape_html_safe((content_for?(:title) ? yield(:title) : 'Sortable Table Sandbox'))).to_s)); ; @output_buffer.safe_concat(("</title><meta content=\"".freeze)); @output_buffer.safe_concat(((::Temple::Utils.escape_html_safe((content_for?(:description) ? yield(:description) : 'Sortable Table Sandbox'))).to_s)); @output_buffer.safe_concat(("\" name=\"description\" />".freeze)); ; @output_buffer.safe_concat(((stylesheet_link_tag "application", :media => 'all').to_s)); ; @output_buffer.safe_concat(((javascript_include_tag 'application', "data-turbo-track": "reload", defer: true).to_s)); ; @output_buffer.safe_concat(((csrf_meta_tags).to_s)); ; @output_buffer.safe_concat(("</head><body><header>".freeze));

development.rb

1 config.hosts << "9edd8530442843ae839d7c27eedc9a56.vfs.cloud9.ap-northeast-1.amazonaws.com" 2 3 config.web_console.allowed_ips = '0.0.0.0/0'

l:~/environment/raisetech-live8-sample-app (main) $ ./bin/cloud9_dev 05:51:40 web.1 | started with pid 20729 05:51:40 js.1 | unknown command: yarn build --watch 05:51:41 web.1 | => Booting Puma 05:51:41 web.1 | => Rails 7.1.3.2 application starting in development 05:51:41 web.1 | => Run `bin/rails server --help` for more startup options 05:51:41 web.1 | Puma starting in single mode... 05:51:41 web.1 | * Puma version: 6.4.2 (ruby 3.2.3-p157) ("The Eagle of Durango") 05:51:41 web.1 | * Min threads: 5 05:51:41 web.1 | * Max threads: 5 05:51:41 web.1 | * Environment: development 05:51:41 web.1 | * PID: 20729 05:51:41 web.1 | * Listening on http://0.0.0.0:8080 05:51:41 web.1 | Use Ctrl-C to stop 05:51:53 web.1 | Started GET "/" for 124.213.98.78 at 2024-04-01 05:51:53 +0000 05:51:53 web.1 | ActiveRecord::SchemaMigration Load (1.5ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC 05:51:53 web.1 | Processing by FruitsController#index as HTML 05:51:53 web.1 | Rendering layout layouts/application.html.slim 05:51:53 web.1 | Rendering fruits/index.html.slim within layouts/application 05:51:54 web.1 | Fruit Load (1.1ms) SELECT `fruits`.* FROM `fruits` ORDER BY `fruits`.`row_order` ASC 05:51:54 web.1 | ↳ app/views/fruits/index.html.slim:13 05:51:54 web.1 | Rendered fruits/index.html.slim within layouts/application (Duration: 68.1ms | Allocations: 17660) 05:51:54 web.1 | Rendered layout layouts/application.html.slim (Duration: 80.6ms | Allocations: 27215) 05:51:54 web.1 | Completed 500 Internal Server Error in 129ms (ActiveRecord: 17.8ms | Allocations: 39775) 05:51:54 web.1 | 05:51:54 web.1 | 05:51:54 web.1 | 05:51:54 web.1 | ActionView::Template::Error (The asset "application.css" is not present in the asset pipeline. 05:51:54 web.1 | ): 05:51:54 web.1 | 5: title 05:51:54 web.1 | 6: = content_for?(:title) ? yield(:title) : 'Sortable Table Sandbox' 05:51:54 web.1 | 7: meta name="description" content="#{content_for?(:description) ? yield(:description) : 'Sortable Table Sandbox'}" 05:51:54 web.1 | 8: == stylesheet_link_tag "application", :media => 'all' 05:51:54 web.1 | 9: == javascript_include_tag 'application', "data-turbo-track": "reload", defer: true 05:51:54 web.1 | 10: == csrf_meta_tags 05:51:54 web.1 | 11: body 05:51:54 web.1 | 05:51:54 web.1 | app/views/layouts/application.html.slim:8

試したこと・調べたこと

上記の詳細・結果

アプリケーションを立ち上げる際に、

config.hosts << "9edd8530442843ae839d7c27eedc9a56.vfs.cloud9.ap-northeast-1.amazonaws.com"

を追加すると表示されるという記事を見ましたが、表示されませんでした。

The asset "application.css" is not present in the asset pipeline.
と検索すると下記の記事が出たので同様に

config.web_console.allowed_ips = '0.0.0.0/0'

を追加しました。

補足

DBは正しくインストール済みです。

コメントを投稿

0 コメント