前提・実現したいこと
前提
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'
該当するソースコード
ターミナル 本番環境 [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'
あなたの回答
tips
プレビュー