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

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

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

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails 6

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

Ruby on Rails

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

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Q&A

0回答

1022閲覧

Ruby on Rails ActionView::Template::Errorについて

ken1203

総合スコア24

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails 6

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

Ruby on Rails

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

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

0グッド

0クリップ

投稿2020/12/15 11:46

編集2020/12/16 12:17

前提・実現したいこと

前提
Ruby on Rails6(action text導入)にてアプリを作成
AWS linux2にてデプロイ実施
unicornを起動

実現したいこと
本番環境にデプロイしたい

発生している問題・エラーメッセージ

cat production.log ActionView::Template::Error (couldn't find file 'trix/dist/trix' with type 'text/css'

unicornを起動すると下記の画面になります。
イメージ説明

該当するソースコード

ターミナル 本番環境 [ec2-user@*********** Dr_tetsu]$ ps aux | grep unicorn ec2-user 20363 0.2 10.3 438064 104480 ? Sl 11:15 0:01 unicorn_rails master -c config/unicorn.rb -E production -D ec2-user 20367 0.0 9.7 439948 98256 ? Sl 11:15 0:00 unicorn_rails worker[0] -c config/unicorn.rb -E production -D ec2-user 20597 0.0 0.0 119436 932 pts/1 S+ 11:27 0:00 grep --color=auto unicorn [ec2-user@**********: Drtetsu]$ kill 20363 [ec2-user@************ Dr_tetsu]$ RAILS_SERVE_STATIC_FILES=1 unicorn_rails -c config/unicorn.rb -E production -D [ec2-user@***********Dr_tetsu]$
cat production.log I, [2020-12-15T11:18:07.117479 #20367] INFO -- : [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] Started GET "/" for 103.5.140.155 at 2020-12-15 11:18:07 +0000 I, [2020-12-15T11:18:07.118194 #20367] INFO -- : [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] Processing by TopController#index as HTML I, [2020-12-15T11:18:07.118918 #20367] INFO -- : [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] Rendering home/top.html.haml within layouts/application I, [2020-12-15T11:18:07.120054 #20367] INFO -- : [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] Rendered home/_footer.html.haml (Duration: 0.2ms | Allocations: 143) I, [2020-12-15T11:18:07.120142 #20367] INFO -- : [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] Rendered home/top.html.haml within layouts/application (Duration: 1.2ms | Allocations: 600) I, [2020-12-15T11:18:07.122648 #20367] INFO -- : [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] Completed 500 Internal Server Error in 4ms (Allocations: 2762) F, [2020-12-15T11:18:07.123849 #20367] FATAL -- : [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] ActionView::Template::Error (couldn't find file 'trix/dist/trix' with type 'text/css' Checked in these paths: /var/www/Dr_tetsu/app/assets/config /var/www/Dr_tetsu/app/assets/images /var/www/Dr_tetsu/app/assets/stylesheets /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/jquery-rails-4.4.0/vendor/assets/javascripts /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/actioncable-6.0.3.4/app/assets/javascripts /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activestorage-6.0.3.4/app/assets/javascripts /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/actionview-6.0.3.4/lib/assets/compiled /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/turbolinks-source-5.2.0/lib/assets/javascripts /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bourbon-7.0.0/core /var/www/Dr_tetsu/node_modules /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/font-awesome-sass-5.15.1/assets/stylesheets /home/ec2-user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/font-awesome-sass-5.15.1/assets/fonts): [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] 5: <%= csrf_meta_tags %> [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] 6: <%= csp_meta_tag %> [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] 7: [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] 8: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] 9: <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] 10: </head> [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] 11: [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] app/assets/stylesheets/actiontext.scss:6 [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] app/views/layouts/application.html.erb:8 [70af2148-41c5-4f77-a0b2-4dc9fa9b296a] app/controllers/top_controller.rb:3:in `index'

試したこと(仮説)

cat production.logにてエラーログを確認する。

ActionView::Template::Error (couldn't find file 'trix/dist/trix' with type 'text/css'

について調べました。
下記のリンクを参照して確認しましたが、エラー解決に至りませんでした。
リンク内容
仮説としてactiton textを本番環境にて起動するための準備が不十分?であると
考えています。

補足

ローカル環境では問題なく起動されているのですが本番環境ではエラーになります。
初心者で言葉足らずで申し訳ありませんがご教示頂けたらと思い質問させて頂きました。
宜しくお願い致します。

補足

Gemfile source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.5.1' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6.0.3', '>= 6.0.3.4' # Use mysql as the database for Active Record gem 'mysql2', '>= 0.5.3' # Use Puma as the app server gem 'puma', '~> 4.1' # Use SCSS for stylesheets gem 'sass-rails', '>= 6' # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker gem 'webpacker', '~> 4.0' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.7' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use Active Model has_secure_password # gem 'bcrypt', '~> 3.1.7' # Use Active Storage variant # gem 'image_processing', '~> 1.2' # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.4.2', require: false group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen', '~> 3.2' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' end group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' # Easy installation and use of web drivers to run system tests with browsers gem 'webdrivers' end group :production do gem 'unicorn', '5.4.1' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'actiontext' gem 'image_processing', '~> 1.2' gem 'haml-rails' gem 'bourbon' gem 'devise' gem 'jquery-rails' gem 'font-awesome-sass' gem 'fog-aws'

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

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

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

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

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

m.ts10806

2020/12/15 20:06

エラー内容だけだと結局同じかと思います。(エラーの通り、もしくはエラーで調べて出てくる内容しか答えようがない) 実際のアプリケーションの構成(入れてるGemなど含めて)、コードもご提示ください。 大抵、環境間の違いがそのままアプリケーションに反映されるので 「必要なライブラリやプラグインが足りてない、設定が足りてない」くらいでしょうけど、 この質問内容だけでは具体的なことは分かりません。
m.ts10806

2020/12/15 20:07

あとteratailの投稿機能で画像が添付できます。 外部サイトだとその外部サイトになにかあったときに(メンテナンスなど) 画像が参照できなくなるので、なるべく投稿機能を利用してください。
ken1203

2020/12/16 03:57

m.ts10806様 ご返信ありがとうございます! >実際のアプリケーションの構成(入れてるGemなど含めて)、コードもご提示ください。 承知しました。補足に追記しましたのでご参照お願い致します。 >大抵、環境間の違いがそのままアプリケーションに反映される この辺りも調べて原因追求してみます! ありがとうございます!
ken1203

2020/12/16 03:59

m.ts10806様 画像の添付につきましても今後は画像添付機能を利用して 投稿させて頂きたいと思います。 ご教示頂きありがとうございます!
m.ts10806

2020/12/16 06:06

>画像の添付につきましても今後は せっかく質問編集できるのですから、いつになるか分からない今後に後回しにはされないほうが良いかと思います
ken1203

2020/12/16 06:21

m.ts10806様 ご返信ありがとうございます! >せっかく質問編集できるのですから、いつになるか分からない今後に後回しにはされないほうが良いかと思います。 訂正致しましたので確認お願いします!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.46%

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

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

質問する

関連した質問